I'm trying to make a downloader to rip from DirecTV Stream. However, with my best efforts, I'm getting a error saying {"errorReason":"10062","description":"Mismatch in request information - Device","message":"DRM DeviceID Mismatch"}
What I don't understand is that the request headers match up to the device which Ive extracted the CDM from, which is Android on a emulator, I proxied the request from the emulator.
It seems to use a cert, and I added that to the mix, but it required headers for the cert.
Heres the request for the DRM license
Here's the header for the certCode:headers = { "accept": "application/json", # 'accept-encoding': 'gzip, deflate, br, zstd', "accept-language": "en-US,en;q=0.9", "authorization": "<redacted>", "connection": "keep-alive", "content-type": "application/json", "flow_context": "activate_1730052493.396", "host": "api.cld.dtvce.com", "origin": "https://stream.directv.com", "referer": "https://stream.directv.com/", "sec-ch-ua": '"Chromium";v="130", "Microsoft Edge";v="130", "Not?A_Brand";v="99"', "sec-ch-ua-mobile": "?1", "sec-ch-ua-platform": '"Android"', "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "cross-site", "user-agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Mobile Safari/537.36 EdgA/130.0.0.0", } json_data = { "contentID": "4734", "contentType": "2", "identityCookie": "<redacted>", "authorizationToken": "<redacted>", "licenseChallenge": "<redacted>", }
Here's the code I wroteCode:headers = { "accept": "*/*", # 'accept-encoding': 'gzip, deflate, br, zstd', "accept-language": "en-US,en;q=0.9", "connection": "keep-alive", "host": "stream.directv.com", "referer": "https://stream.directv.com/watchnow", "sec-ch-ua": '"Chromium";v="130", "Microsoft Edge";v="130", "Not?A_Brand";v="99"', "sec-ch-ua-mobile": "?1", "sec-ch-ua-platform": '"Android"', "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "user-agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Mobile Safari/537.36 EdgA/130.0.0.0", }
Code:def decrypt_content(): license_url = "https://api.cld.dtvce.com/rights/management/mdrm/vgemultidrm/v1/widevine/license" # prepare pssh pssh = PSSH( "AAAAOHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAABgSEBWvzdlJ4r7/P7MZ4yxCMV1I88aJmwY=" ) # load device device = Device.load(extracted_device) # load CDM from device cdm = Cdm.from_device(device) # open CDM session session_id = cdm.open() cert = requests.get( url="https://stream.directv.com/att.tv/wv/cert_license_widevine_com.bin", cookies=DRMHeader2.cookies, headers=DRMHeader2.headers, ) print(cert.content) cert = cert.content cdm.set_service_certificate( certificate=cert, session_id=session_id, ) # Generate the challenge challenge = cdm.get_license_challenge(session_id, pssh) DRMHeader.json_data["licenseChallenge"] = base64.b64encode(challenge).decode( "utf-8" ) print(DRMHeader.json_data["licenseChallenge"]) # send license challenge license = requests.post( url=license_url, headers=DRMHeader.headers, json=DRMHeader.json_data, ) print(license.content) license = base64.b64decode(license.json()["licenseData"][0]) print(license) # Replace invalid characters license = license.json()["license"].replace("-", "+").replace("_", "/") # Parse the license cdm.parse_license(session_id, license) # assign variable for returned keys returned_keys = "" for key in cdm.get_keys(session_id): if key.type != "SIGNING": returned_keys += f"{key.kid.hex}:{key.key.hex()}\n" # close session, disposes of session data cdm.close(session_id) # Return the keys return returned_keys
+ Reply to Thread
Results 1 to 5 of 5
-
-
Remember, this is a paid service, so this thread is gone as soon as Baldrick discovers it.
I've had somebody request DirecTV support for WidevineFetch. All I wrote down here was "Widevine Device must be registered" and I remember that they sent some challenge (or similar) to the license server before playback to "register" the device first. This explains the "DRM DeviceID Mismatch" error you're encountering. I think WidevineProxy2 should work for DirecTVBypass HMACs, One-time-tokens and Lic.Wrapping: https://github.com/DevLARLEY/WidevineProxy2 -
Thanks, that seems to have done the trick to be able to get the key
Ive seen threads for paid services here, I didnt mean to break the rules, does it depend on what baldrick is able to findLast edited by Larsenv; 4th Apr 2025 at 20:32.
-
Actually yes, I think he's the only moderator on this forum, so only the threads that he's able to read can be locked
Bypass HMACs, One-time-tokens and Lic.Wrapping: https://github.com/DevLARLEY/WidevineProxy2
Similar Threads
-
Videoredo Mpeg Stream Error issue
By snafoo in forum EditingReplies: 0Last Post: 14th Jan 2024, 15:24 -
Error check with ffmpeg: Output file #0 does not contain any stream
By Valit in forum Video ConversionReplies: 1Last Post: 18th Jun 2023, 04:44 -
error when trying to download live stream
By filipino in forum Video Streaming DownloadingReplies: 2Last Post: 1st Feb 2022, 16:00 -
FFmpeg error: non-monotonous DTS in output stream
By Hakunamatata67 in forum Video ConversionReplies: 1Last Post: 30th Jan 2022, 07:07 -
Output file #0 does not contain any stream error using ytl
By Kizuna in forum Video Streaming DownloadingReplies: 4Last Post: 9th Nov 2021, 04:27