Kodi Community Forum
[solved] hbogo.bg and inputstream.adaptive - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: VideoPlayer InputStream (https://forum.kodi.tv/forumdisplay.php?fid=312)
+---- Thread: [solved] hbogo.bg and inputstream.adaptive (/showthread.php?tid=320774)



[solved] hbogo.bg and inputstream.adaptive - stefansaraev - 2017-08-30

Hi there,

I am trying to play a drm encrypted content from hbogo.bg, we dont have an addon for that yet but a guy is writing one as we speak (he'll be doing the login and parsing part, but that will take some time)

hbo.go is using smoothstream + widevine, after a day spent in chrome dev tools I've figured out few things, but I can't understand what inputstream.adaptive.license_data is suposed to be.

From what I can see from the request payload that chrome sends to wv license server, and from their castlab player configuration, it seems to be a widevine header generated from following data:

Code:
"widevineHeader": {
        "provider": "castlabs",
        "contentId": "fkj3ljaSdfalkr3j",
        "trackType": "",
        "policy": ""
    },

here is what I've been trying so far

Code:
# url: https://edgecastcdnsecure.hbogo.eu/3a9da050-05b0-4d3c-9f5f-8068ff892b31/1195671/COMP/movie/mux_2c177faf-f633-4c86-8594-fefd653b6c81.ism/Manifest
url = get_url(action='play', video=video['video'])

license_server = 'https://lic.drmtoday.com/license-proxy-widevine/cenc/'

dt_custom_data = "base64 encoded json string containing my userId and player session id"
x_dt_auth_token = "more base64 encoded known stuff"
headers = 'dt-custom-data=' + dt_custom_data + '&x-dt-auth-token=' + x_dt_auth_token + '&Origin=https://www.hbogo.bg'

license_key = license_server + '|' + headers + '|B{SSM}|'

list_item.setProperty('inputstreamaddon', 'inputstream.adaptive')
list_item.setProperty('inputstream.adaptive.manifest_type', 'ism')
list_item.setProperty('inputstream.adaptive.license_type', 'com.widevine.alpha')
list_item.setProperty('inputstream.adaptive.license_data', 'whatever')
list_item.setProperty('inputstream.adaptive.license_key', license_key)

Anyone can give me a hint?

cc @peak3d

P.S: using kodi v18 and inputstream.adaptive both from git

EDIT: not sure how I posted in wrong category, thanks @DarrenHill


RE: hbogo.bg and inputstream.adaptive - DarrenHill - 2017-08-30

Thread moved to add-on development.


RE: hbogo.bg and inputstream.adaptive - stefansaraev - 2017-08-30

k. answering to myself.

after quick look at Bento4 source I think I figured it out, now getting response from wv license server.

Code:
...
headers = 'dt-custom-data=' + dt_custom_data + '&x-dt-auth-token=' + x_dt_auth_token + '&Origin=https://www.hbogo.bg&Content-Ty
pe='
license_key = license_server + '|' + headers + '|R{SSM}|JRlicense'
list_item.setProperty('inputstreamaddon', 'inputstream.adaptive')
list_item.setProperty('inputstream.adaptive.manifest_type', 'ism')
list_item.setProperty('inputstream.adaptive.license_type', 'com.widevine.alpha')
list_item.setProperty('inputstream.adaptive.license_data', 'ZmtqM2xqYVNkZmFsa3Izag==')
list_item.setProperty('inputstream.adaptive.license_key', license_key)



RE: hbogo.bg and inputstream.adaptive - stefansaraev - 2017-08-30

@peak3d

I am getting
Code:
ERROR: AddOnLog: InputStream Adaptive: Unable to find license in JSON string

am I supposed to use JRlicense ?

EDIT: also solved Big Grin


RE: [solved] hbogo.bg and inputstream.adaptive - micahg - 2017-09-16

I'm at a similar point for my addon to where you got stuck. I can see calls out to https://prod-lic2widevine.sd-ngp.net/proxy and I can get the oauth token to call that api, I'm just not sure how to put it into use.

Is this documented anywhere?