medvm / widevine_keys

This repo created for bypassing Widevine L3 DRM and obtaining keys.
450 stars 186 forks source link

Server did not issue license #67

Open Ozair0 opened 2 years ago

Ozair0 commented 2 years ago

server did not issue license, make sure you have correctly pasted all the required headers in the headers.py. Also check json/raw params of POST request.

Inputs: Input MPD URL: https://ffprod2.b-cdn.net/c/278/m/048db3a4-90da-11ea-84b7-329eebf088bf.ism/manifest.1920x1080.mpd License URL: https://www.darya.net/api/1.0/license Unable to find PSSH in mpd. Edit getPSSH.py or enter PSSH manually: AAAAQ3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAACMIARIQBI2zpJDaEeqEtzKe6/CIvxoNd2lkZXZpbmVfdGVzdA==

PSSH obtained. AAAAQ3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAACMIARIQBI2zpJDaEeqEtzKe6/CIvxoNd2lkZXZpbmVfdGVzdA==

header.py

import requests

cookies = { '_ga': 'GA1.2.483962611.1648017743', '_gid': 'GA1.2.548169006.1648017743', '__oagr': 'true', '_gat_gtag_UA_130192816_5': '1', }

headers = { 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="99", "Microsoft Edge";v="99"', 'content-type': 'text/xml; charset=utf-8', 'sec-ch-ua-mobile': '?0', 'soapaction': '"http://schemas.microsoft.com/DRM/2007/03/protocols/AcquireLicense"', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.46', 'sec-ch-ua-platform': '"Windows"', 'Accept': '/', 'Origin': 'https://www.darya.net', 'Sec-Fetch-Site': 'same-origin', 'Sec-Fetch-Mode': 'cors', 'Sec-Fetch-Dest': 'empty', 'Referer': 'https://www.darya.net/', 'Accept-Language': 'en-US,en;q=0.9',

Requests sorts cookies= alphabetically

# 'Cookie': '_ga=GA1.2.483962611.1648017743; _g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XBOwuTK8b2ioxjrg6OFhiMck+z9M5FHg+ktY7YB8iY+0V6B/Op2cQGtLaZ2E9lsomlQpxL+LiPI7UWEqmALEGH/Pk5tdLnlFRjEk2PPc8YURw+/nkP9tqJ/AXQwaXc9iwC5yxlYPCsp/Tc4=' provider = 'kakaotv' releasePid = "_qVpiY31v_oU"

response = requests.post('https://www.darya.net/api/1.0/license', headers=headers, params=params, cookies=cookies, data=data)

response = requests.post('https://widevine-proxy.ott.yandex.ru/proxy', headers=headers, cookies=cookies, data=data)

print(f'{chr(10)}widevine_license: {response.content}')

NB. Original query string below. It seems impossible to parse and

reproduce query strings 100% accurately so the one below is given

in case the reproduced version is not "correct".

response = requests.options('https://api.ott.kinopoisk.ru/v12/license-affected-content-metadata?contentIds=4b63db58ab27e92b90a457e533b00007&serviceId=25', headers=headers)

dash-cenc/hdr10_uhd_hevc_ec3.mpd

https://strm.yandex.ru/vh-ottenc-converted/vod-content/4315082489d87677b21f7c83593fcb73/8614535x1631802676x41611665-4e76-41ac-93a7-5070b77b5f3c/dash-cenc/sdr_uhd_hevc_ec3.mpd

'GET /certificate HTTP/1.1'


I have also added raw-data but still same issue any idea?