pymsl icon indicating copy to clipboard operation
pymsl copied to clipboard

Error in getting licence

Open chicc0 opened this issue 7 years ago • 16 comments

Another error

'dataBase64': base64.b64encode(challenge).decode('utf-8'),

File "/usr/lib/python2.7/base64.py", line 54, in b64encode encoded = binascii.b2a_base64(s)[:-1] TypeError: b2a_base64() argument 1 must be string or buffer, not int

Any idea?

chicc0 avatar Nov 21 '18 18:11 chicc0

What are you passing as the challenge?

truedread avatar Nov 21 '18 18:11 truedread

MQ==

chicc0 avatar Nov 21 '18 19:11 chicc0

Are you passing it correctly? Read https://github.com/truedread/pymsl#get_licensechallenges to make sure.

truedread avatar Nov 21 '18 22:11 truedread

Sorry, really having an hard time, can u explisn how to get challenge parameter please?

chicc0 avatar Nov 21 '18 23:11 chicc0

@truedread can u check if license data is successfully received using this new pymsl api? Seems not for me.

If you need some reference to upgrade, take a look here https://github.com/asciidisco/plugin.video.netflix/tree/msl2/resources/lib

The netflix addon is with a very advanced version derived from pymsl https://github.com/asciidisco/plugin.video.netflix/blob/msl2/resources/lib/MSLv2.py

I'm making my own changes, but I'm not getting connection to the license server in API v2(ERROR 400), I do not know yet if it's a bug, or something on the NF side.

See u. ☕️

MythodeaLoL avatar Dec 02 '18 09:12 MythodeaLoL

@truedread

Are you passing it correctly? Read https://github.com/truedread/pymsl#get_licensechallenges to make sure.

Doesn't seem to describe how to get the licensechallanges, can you explain or update the link?

Nemesis7 avatar Dec 04 '18 06:12 Nemesis7

Anyone got this working with the new api? Is the session_id, the one i get when opening the drm session, for example widevine session? My opened session says session_id=b'\x8c\x9d\xe7\xc9>:\x95h:\x98\xdc\x14\xe7\xac\x85\x9c , i encoded that id to hex string. With that session and challenge i requested license, but i don't know how to proceed, my drm session is not decrypting the license?

This is what the license request returns...

https://www.netflix.com:443 "POST /nq/msl_v1/cadmium/pbo_licenses/%5E1.0.0/router HTTP/1.1" 200
{  
   'version':2,
   'id':15552746826413,
   'serverTime':1555274683444,
   'from':'[email protected]/[email protected]',
   'result':[  
      {  
         'licenseResponseBase64':'CAI==',
         'providerSessionToken':None,
         'links':{  
            'releaseLicense':{  
               'rel':'releaseLicense',
               'href':'/releaseLicense?drmLicenseContextId=E1-BQ;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX;STANDARD;1555274683424&licenseId=wv_sd_'
            }
         },
         'sessionId':'8C9DE7C93E3A95683A98DC14E7AC859C'
      }
   ]
}

Edit: I got it working, i just had a wrong return value for get_license function...

armin884 avatar Apr 14 '19 21:04 armin884

@armin884 sessionId is just a Unix timestamp, just do int(time.time() * 10000) (though the actual value does not seem to matter, just int(time.time()) or a hardcoded value may also work).

ghost avatar Apr 14 '19 21:04 ghost

@nyuszika7h But the documentation for pymsl says @param session_id: DRM specific session ID passed as a string and why do i have to pass that value to the get_license(challenge, session_id) fuction, if that value doesn't matter? Did you got that licence request work?

armin884 avatar Apr 14 '19 21:04 armin884

@armin884 Yes, the license request works fine for me using a session ID like that.

ghost avatar Apr 14 '19 21:04 ghost

I know someone else asked this and there was no answer. Is the "challenge" variable provided in the provided in the return dict of "load_manifest(viewable_id)"? Can someone give a full working example without there password?

Thank you so much in advance.

gjames2467 avatar Jun 26 '19 04:06 gjames2467

@armin884 or @nyuszika7h or @truedread can you help me to get the license?

Nintendocustom avatar Sep 29 '20 19:09 Nintendocustom

does anyone have some information regarding the generation of the "challenge"? As far i understood one need to utilize "libwidevinecdm.so" somehow to generate the challenge, but i'm utterly stuck there. Normally the EME API is integrated with the browser, one way to do this would be loading chromium headless and try to access it, but i'm not sure about that. Any hint would be great :)

h1f0x avatar Nov 16 '20 11:11 h1f0x

I theoretically could help you to get the challenge but it won't help you until you have some files that are needed for this to work for example device_client_id_blob.

Nintendocustom avatar Nov 16 '20 12:11 Nintendocustom

i figured yes. But maybe it's best to not fiddle with own requests anyway. Why reinvent the wheel :) Going a different approach i think. But thanks man!

h1f0x avatar Nov 16 '20 12:11 h1f0x

Anyone got this working with the new api? Is the session_id, the one i get when opening the drm session, for example widevine session? My opened session says session_id=b'\x8c\x9d\xe7\xc9>:\x95h:\x98\xdc\x14\xe7\xac\x85\x9c , i encoded that id to hex string. With that session and challenge i requested license, but i don't know how to proceed, my drm session is not decrypting the license?

This is what the license request returns...

https://www.netflix.com:443 "POST /nq/msl_v1/cadmium/pbo_licenses/%5E1.0.0/router HTTP/1.1" 200
{  
   'version':2,
   'id':15552746826413,
   'serverTime':1555274683444,
   'from':'[email protected]/[email protected]',
   'result':[  
      {  
         'licenseResponseBase64':'CAI==',
         'providerSessionToken':None,
         'links':{  
            'releaseLicense':{  
               'rel':'releaseLicense',
               'href':'/releaseLicense?drmLicenseContextId=E1-BQ;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX;STANDARD;1555274683424&licenseId=wv_sd_'
            }
         },
         'sessionId':'8C9DE7C93E3A95683A98DC14E7AC859C'
      }
   ]
}

Edit: I got it working, i just had a wrong return value for get_license function...

Can you please explain how you got it working? Because i have the same sessionId error..

chicc0 avatar Nov 27 '20 12:11 chicc0