license url placement and gitignore add mp4s
This commit is contained in:
parent
4345c71ec9
commit
e823f88d2b
1
.gitignore
vendored
1
.gitignore
vendored
@ -19,6 +19,7 @@ env/
|
||||
urls.txt
|
||||
urls/
|
||||
cdm/
|
||||
*.mp4
|
||||
|
||||
# misc
|
||||
test.py
|
||||
|
@ -25,8 +25,6 @@ headers = {
|
||||
'Cache-Control': 'no-cache',
|
||||
}
|
||||
|
||||
license_url = "https://npo-drm-gateway.samgcloud.nepworldwide.nl/authentication"
|
||||
|
||||
if platform.system() == "Windows":
|
||||
windows_flag = True
|
||||
else:
|
||||
@ -121,36 +119,16 @@ def find_CSRF(targetId, plus_cookie):
|
||||
response_CSRF = requests.get('https://npo.nl/start/api/auth/session', headers=headers, cookies=plus_cookie)
|
||||
response_cookies = response_CSRF.cookies.get_dict()
|
||||
|
||||
if plus_cookie:
|
||||
csrf_label = "__Secure-next-auth.session-token"
|
||||
else:
|
||||
csrf_label = "__Host-next-auth.csrf-token"
|
||||
|
||||
# LOGGED IN: __Secure-next-auth.session-token
|
||||
# LOGGED OUT: __Host-next-auth.csrf-token
|
||||
# sigh.
|
||||
|
||||
csrf = response_cookies[csrf_label]
|
||||
|
||||
csrf_cookies = {
|
||||
csrf_label: csrf,
|
||||
'__Secure-next-auth.callback-url': 'https%3A%2F%2Fnpo.nl',
|
||||
}
|
||||
|
||||
if not plus_cookie:
|
||||
plus_cookie = csrf_cookies
|
||||
|
||||
json_productId = {
|
||||
'productId': targetId,
|
||||
}
|
||||
|
||||
response_token = requests.get('https://npo.nl/start/api/domain/player-token', cookies=plus_cookie, headers=headers, params=json_productId)
|
||||
response_token = requests.get('https://npo.nl/start/api/domain/player-token', cookies=response_cookies, headers=headers, params=json_productId)
|
||||
token = response_token.json()["token"]
|
||||
return token
|
||||
|
||||
|
||||
|
||||
|
||||
def find_MPD(token, url, plus_cookie):
|
||||
headers['Authorization'] = token
|
||||
|
||||
@ -189,7 +167,7 @@ def find_key(mpd, pssh):
|
||||
}
|
||||
|
||||
cert_b64 = None
|
||||
key_extractor = KeyExtractor(pssh, cert_b64, license_url, headers_license)
|
||||
key_extractor = KeyExtractor(pssh, cert_b64, "https://npo-drm-gateway.samgcloud.nepworldwide.nl/authentication", headers_license)
|
||||
keys = key_extractor.get_keys()
|
||||
wvdecrypt = WvDecrypt(init_data_b64=pssh, cert_data_b64=cert_b64, device=device_android_generic)
|
||||
raw_challenge = wvdecrypt.get_challenge()
|
||||
|
Loading…
x
Reference in New Issue
Block a user