Good evening,
I have a video :https://www.france.tv/enfants/six-huit-ans/tortues-ninja-les-chevaliers-d-ecaille/sais...chnodrome.html
le mpd:https://cloudingest.ftven.fr/3c05cd49b9666/269ac3a6-efcc-4b89-8ed4-64810da8aa29-171820...m/manifest.mpd
the ppsh:AAAAYXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAEEIA RIQJprDpu/MS4mO1GSBDaiqKRoFTmFncmEiJDI2OWFjM2E2LWVmY2MtNGI4O S04ZWQ0LTY0ODEwZGE4YWEyOQ==
I can't find the license (and maybe the headers) to use http://108.181.133.95:8080/
Thank you for your help to explain me where to find license
Translated with DeepL.com (free version)
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
Try StreamFab Downloader and download streaming video from Youtube, Netflix, Amazon! Download free trial.
+ Reply to Thread
Results 1 to 13 of 13
Thread
-
-
First time seeing DRM on francetv content. Here is the key :
Code:269ac3a6efcc4b898ed464810da8aa29:c9fd40e2225059bf1c172ad56e7927bd
Code:N_m3u8DL-RE "https://cloudingest.ftven.fr/3c05cd49b9666/269ac3a6-efcc-4b89-8ed4-64810da8aa29-1718205635_france-domtom_DRM.ism/manifest.mpd" --key 269ac3a6efcc4b898ed464810da8aa29:c9fd40e2225059bf1c172ad56e7927bd -M mkv --save-name "tortues.ninja.les.chevaliers.decaille.S01E61.1080p.WEB"
The license url :Code:https://api-drm.ftven.fr/v1/wvls/contentlicenseservice/v1/licenses
Last edited by aqzs; 24th Jun 2024 at 17:24.
-
I find the nv-authorizations but I have an error :ERROR
Wrong headers: while scanning a simple key in "<unicode string>", line 2, column 1: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1 ... ^ could not find expected ':' in "<unicode string>", line 2, column 412: ... Eaz3rpGJmrfFFE14a_ciG4ayA1ZEUodM ^ -
You are using http://108.181.133.95:8080/ to get keys ? I never used that sorry
-
I use pywidevine.
Here is a small script that wll give you download command based on the video url (with or without DRM) :
HTML Code:from pywidevine.cdm import Cdm from pywidevine.device import Device from pywidevine.pssh import PSSH import requests from slugify import slugify import xml.etree.ElementTree as ET import re def getpssh(url_mpd): psshs = [] response = requests.get(url_mpd) root = ET.fromstring(response.content) for i in range(20): for j in range(20): for k in range(20): for l in range(20): try: if root[i][j][k][l].text not in psshs and len(root[i][j][k][l].text) > 70 and len(root[i][j][k][l].text) < 190: psshs.append(root[i][j][k][l].text) except: pass for pssh in psshs: return pssh def getkey(pssh, lic_token): headers = {'nv-authorizations': lic_token} pssh = PSSH(pssh) lic_url = 'https://api-drm.ftven.fr/v1/wvls/contentlicenseservice/v1/licenses' device = Device.load(DEVICEPATH) cdm = Cdm.from_device(device) session_id = cdm.open() challenge = cdm.get_license_challenge(session_id, pssh) licence = requests.post(lic_url, headers = headers, data=challenge) licence.raise_for_status() cdm.parse_license(session_id, licence.content) keys = [] for key in cdm.get_keys(session_id): if key.type=='CONTENT': keys.append(f"{key.kid.hex}:{key.key.hex()}") cdm.close(session_id) return keys def getvideo(ID): headers = {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',} params = (('country_code', 'FR'),('w', '1084'),('h', '610'),('screen_w', '1774'),('screen_h', '1033'),('player_version', '5.113.5'),('domain', 'www.france.tv'),('device_type', 'desktop'),('browser', 'chrome'),('browser_version', '126'),('os', 'macos'),('os_version', '10_15_7'),('diffusion_mode', 'tunnel_first'),('gmt', '+0200'),('video_product_id', '6137147'),('capabilities', 'drm'),) data = requests.get(f'https://k7.ftven.fr/videos/{ID}', headers=headers, params=params).json() mpd_url = data['video']['url'] name = slugify(data['meta']['title'] + '.' + data['meta']['pre_title'], separator='.', lowercase=False) if 'drm' in mpd_url: pssh = getpssh(mpd_url) TOKEN = requests.post('https://k7.ftven.fr/drm-token', headers=headers, params=(('v', '2'),), json={"id":ID,"drm_type":"widevine","license_type":"online"}).json()['token'] key = getkey(pssh, TOKEN) print(f"""N_m3u8DL-RE "{mpd_url}" --save-name "{name}" --select-video best --select-audio all --select-subtitle all -mt -M format=mkv --log-level OFF --key """ + ' --key '.join(key)) else: print(f"""N_m3u8DL-RE "{mpd_url}" --save-name "{name}" --select-video best --select-audio all --select-subtitle all -mt -M format=mkv --log-level OFF""") # urlvid = 'https://www.france.tv/enfants/six-huit-ans/tortues-ninja-les-chevaliers-d-ecaille/saison-1/6137147-irma-se-fait-remarquer.html' DEVICEPATH = "device.wvd" urlvid = input('Video url: ') r = requests.get(urlvid) matches = re.findall(r'"videoId":\s*"(.*?)"', r.text) if matches: videoid = matches[0] getvideo(videoid)
-
You can use this much simpler script if you just want the keys :
HTML Code:from pywidevine.cdm import Cdm from pywidevine.device import Device from pywidevine.pssh import PSSH import requests lic_token = input('token: ') headers = {'nv-authorizations': lic_token} pssh = input("PSSH? ") pssh = PSSH(pssh) lic_url = 'https://api-drm.ftven.fr/v1/wvls/contentlicenseservice/v1/licenses' device = Device.load("device.wvd") cdm = Cdm.from_device(device) session_id = cdm.open() challenge = cdm.get_license_challenge(session_id, pssh) licence = requests.post(lic_url, headers = headers, data=challenge) licence.raise_for_status() cdm.parse_license(session_id, licence.content) for key in cdm.get_keys(session_id): if key.type=='CONTENT': print(f"\n--key {key.kid.hex}:{key.key.hex()}") cdm.close(session_id)
-
the script not work : python3.10 pywidevine.py
Traceback (most recent call last):
File "/home/Bureau/N_m3u8DL-RE_Beta_linux-x64/pywidevine.py", line 1, in <module>
from pywidevine.cdm import Cdm
File "/home/Bureau/N_m3u8DL-RE_Beta_linux-x64/pywidevine.py", line 1, in <module>
from pywidevine.cdm import Cdm
ModuleNotFoundError: No module named 'pywidevine.cdm'; 'pywidevine' is not a package -
The script works for sure. Rename it other than pywidevine, it's the name of the library you are using, you shouldn't name a file the same as a lib, it's confusing for python. Since you never used pywidevine before install it using :
Code:pip install pywidevine
-
I use second link I download private key client id
the script :import sys
from pywidevine import Device
if len(sys.argv) < 2:
print(f'usage: {sys.argv[0]} <private-key-file> <client-id-blob> or {sys.argv[0]} <file.wvd>')
sys.exit(1)
if len(sys.argv) >= 3:
with open(sys.argv[1], 'rb') as f:
private_key = f.read()
with open(sys.argv[2], 'rb') as f:
client_id = f.read()
device = Device(
private_key=private_key,
client_id=client_id,
type_=Device.Types['ANDROID'],
security_level=3,
flags=None)
else:
device = Device.load(sys.argv[1])
print(device)
I have an error: python3.10 device private_key.pem client_id.bin
Traceback (most recent call last):
File "/home/Bureau/N_m3u8DL-RE_Beta_linux-x64/device", line 19, in <module>
type_=Device.Types['ANDROID'],
AttributeError: type object 'Device' has no attribute 'Types' -
I use your script :
python3 pywidevine.py
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6IjkxNT YyMCJ9.eyJ0eXAiOiJDb250ZW50QXV0aFoiLCJ2ZXIiOiIxLjA iLCJleHAiOjE3MTkyNjgxOTIsImNvbnRlbnRSaWdodHMiOlt7I mNvbnRlbnRJZCI6IjI2OWFjM2E2LWVmY2MtNGI4OS04ZWQ0LTY 0ODEwZGE4YWEyOSIsInN0YXJ0IjoiMjAyNC0wNi0xM1QyMjowM DowMFoiLCJlbmQiOiIyMDI0LTA2LTI1VDA0OjE5OjUyWiIsInV zYWdlUnVsZXNQcm9maWxlSWQiOiJIRF9IRENQMCIsInN0b3JhY mxlIjpmYWxzZX1dfQ.Zee7SRH20-NEaz3rpGJmrfFFE14a_ciG4ayA1ZEUodM
PSSH? AAAAYXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAEEIARIQJp rDpu/MS4mO1GSBDaiqKRoFTmFncmEiJDI2OWFjM2E2LWVmY2MtNGI4O S04ZWQ0LTY0ODEwZGE4YWEyOQ==
Traceback (most recent call last):
File "/home/ludo/Bureau/N_m3u8DL-RE_Beta_linux-x64/widevine.py", line 15, in <module>
licence.raise_for_status()
File "/home/ludo/.local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api-drm.ftven.fr/v1/wvls/contentlicenseservice/v1/licenses -
Probably token expired (decoded):
Code:{ "typ": "ContentAuthZ", "ver": "1.0", "exp": 1719268192, "contentRights": [ { "contentId": "269ac3a6-efcc-4b89-8ed4-64810da8aa29", "start": "2024-06-13T22:00:00Z", "end": "2024-06-25T04:19:52Z", "usageRulesProfileId": "HD_HDCP0", "storable": false } ] }
Similar Threads
-
Convert drm mpd source to simple mpd or m3u8 without drm.
By alberto404 in forum Newbie / General discussionsReplies: 0Last Post: 5th Aug 2023, 11:05 -
restreaming to non-drm m3u8 from drm mpd
By grabyea in forum Video Streaming DownloadingReplies: 1Last Post: 8th Aug 2022, 00:35 -
DRM Live NO, DRM VoD YES.
By d0b in forum Video Streaming DownloadingReplies: 49Last Post: 7th Oct 2021, 15:41 -
Download DRM protected video and decrypt it with a drm licence url
By vikral in forum Video Streaming DownloadingReplies: 9Last Post: 9th Feb 2021, 02:14 -
[franceTV / akamai] Unreliable m3u8 download, frequent small corruption
By abolibibelot in forum Video Streaming DownloadingReplies: 0Last Post: 18th Dec 2020, 17:24