Good evening, my friends, I'd like to share with you a quite strange problem I encountered in swiss site rsi.ch. Please consider the following urlInspecting I easily found .m3u8, that isCode:https://www.rsi.ch/play/tv/-/video/calcio-uefa-euro-2024-turchia-georgia?urn=urn:swisstxt:video:rsi:1771876It seems there's no encryption. When I try to download the stream, for example with youtube-dl, or N_m3u8DL-RE, or other software, I get the error 403 (Forbidden). And why is it? Weird, isn't it? What to you think about this? Please consider that a swiss vpn is mandatory.Code:https://srgssrch.akamaized.net/hls/live/2022155/srgssr-hls-stream22-ch-dvr/master.m3u8?start=1718724510&end=1718737140&hdnts=exp%3D1718823031%7Eacl%3D%2Fhls%2Flive%2F2022155%2Fsrgssr-hls-stream22-ch-dvr%2F*%7Ehmac%3D353ef164cf31e2bebbbf9926a949eb73b81b50acb7b21e341a72945668eb2387
Thank you very, very much, for all your kind help and precious advices. Have a great evening
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 15 of 15
Thread
-
Last edited by misiek1963; 19th Jun 2024 at 14:25.
-
Make sure to grab the all m3u8 url. I had no issue downloading :
[Attachment 80035 - Click to enlarge] -
Thank you very, very much for prompt answer and kind help, the url used is
Code:https://srgssrch.akamaized.net/hls/live/2022155/srgssr-hls-stream22-ch-dvr/master.m3u8?start=1718724510&end=1718737140&hdnts=exp%3D1718823031%7Eacl%3D%2Fhls%2Flive%2F2022155%2Fsrgssr-hls-stream22-ch-dvr%2F*%7Ehmac%3D353ef164cf31e2bebbbf9926a949eb73b81b50acb7b21e341a72945668eb2387
-
I'm not based in switzeland too, I used a vpn to download. If the video play in your browser you should't get an error.
Here is your video : https://www.swisstransfer.com/d/7c6d6a24-d9ff-4fc9-b744-16a909623bf5 -
-
I used on like that :
Code:https://srgssrch.akamaized.net/hls/live/2022155/srgssr-hls-stream22-ch-dvr/master.m3u8?start=1718724510&end=1718737140&hdnts=exp%3D1718828908%7Eacl%3D%2Fhls%2Flive%2F2022155%2Fsrgssr-hls-stream22-ch-dvr%2F*%7Ehmac%3Dcbcf55dbfbb3162f267a9eded1f495eea38c8ef0e332694203efe49cfde341f0
HTML Code:"authparams": "hdnts=exp=1718828908~acl=/hls/live/2022155/srgssr-hls-stream22-ch-dvr/*~hmac=cbcf55dbfbb3162f267a9eded1f495eea38c8ef0e332694203efe49cfde341f0" "url" : "https://srgssrch.akamaized.net/hls/live/2022155/srgssr-hls-stream22-ch-dvr/master.m3u8?start=1718724510&end=1718737140",
-
Tried with your link but no avail. It seems I have no access to host https://srgssrch.akamaized.net/, even if I should have, as the video plays in browser. Which vpn do you use?
-
-
Thank you for all your help and efforts. I use Nordvpn and now I've tried a swiss obfuscated server, but even in this way I cannot download (error 403 all the time). I inform you that with vpn I haven't any problem to download from rsi.ch play vod. It is really weird. Thanks, again, for all time you've spent to help me
-
Here is the script, it will return download command. The script doesn't not need to be used with a vpn but download will only works with a vpn.
HTML Code:import requests from pprint import pprint import re def geturn(urn): data = requests.get(f'https://il.srgssr.ch/integrationlayer/2.0/mediaComposition/byUrn/{urn}.json', params=(('onlyChapters', 'false'),('vector', 'portalplay'),)).json() for chap in data['chapterList']: NAME = chap['imageTitle'] for ressource in chap['resourceList']: m3u8_url = ressource['url'] if 'start' in m3u8_url: pattern = r"(\/hls\/live\/\d+\/srgssr-hls-stream22-ch-dvr\/)" match = re.search(pattern, m3u8_url) if match: acl = match.group(1) data = requests.get('https://tp.srgssr.ch/akahd/token', params=(('acl', acl + '*'),)).json() token = data['token']['authparams'] m3u8_url = m3u8_url + '&' + token print(f"""N_m3u8DL-RE "{m3u8_url}" --save-name "{NAME}" -M mkv -mt -H 'X-Forwarded-For : 37.120.213.171' """) else: print("No match found.") # URL = 'https://www.rsi.ch/play/tv/-/video/calcio-uefa-euro-2024-turchia-georgia?urn=urn:swisstxt:video:rsi:1771876' URL = input('video url: ') pattern = r'urn=([^&]+)' match = re.search(pattern, URL) if match: urn_value = match.group(1) geturn(urn_value) else: print("No match found.")
edit n°2 : it seems like the token is even useless ! This tiny script should do the job :
HTML Code:import requests from pprint import pprint import re def geturn(urn): data = requests.get(f'https://il.srgssr.ch/integrationlayer/2.0/mediaComposition/byUrn/{urn}.json', params=(('onlyChapters', 'false'),('vector', 'portalplay'),)).json() for chap in data['chapterList']: NAME = chap['imageTitle'] for ressource in chap['resourceList']: m3u8_url = ressource['url'] if 'start' in m3u8_url and 'm3u8' in m3u8_url: print(f"""N_m3u8DL-RE "{m3u8_url}" --save-name "{NAME}" -M mkv -mt -H 'X-Forwarded-For : 37.120.213.171'""") # URL = 'https://www.rsi.ch/play/tv/-/video/calcio-uefa-euro-2024-turchia-georgia?urn=urn:swisstxt:video:rsi:1771876' URL = input('video url: ') pattern = r'urn=([^&]+)' match = re.search(pattern, URL) if match: urn_value = match.group(1) geturn(urn_value) else: print("No match found.")
Last edited by aqzs; 19th Jun 2024 at 16:24.
-
-
My guess is you're connected to your VPN in your browser, but not in your command prompt, so every attempt made by N_m3u8DL-RE is done with your real IP thus yielding a 403.
Run this in your terminal to check it:
Code:C:\>python >>> import requests >>> requests.get('https://api.ipify.org/?format=json').json()["ip"] 'xx.xx.xx.xx'
Edit:
URL parameters are needed in my case. On this note @misiek1963: in the N_m3u8DL-RE command make sure you have your tokenized mpd URL inside double quotes, otherwise the URL parameters won't be used and you'll get a 403.Last edited by white_snake; 19th Jun 2024 at 17:38.
-
Thank you so much for advice. After running the commands I can see that in terminal ip changes accordingly with vpn server. My last swiss server ip, using https://www.whatismyip.com gives the following data
Code:City: Zurich State: Zurich Country: Switzerland Postal Code: 8099 Time Zone: +02:00
-
-
Similar Threads
-
Live stream from rsi.ch
By misiek1963 in forum Video Streaming DownloadingReplies: 4Last Post: 16th Jun 2024, 11:19 -
Strange problem with Mediasetinfinity
By misiek1963 in forum Video Streaming DownloadingReplies: 22Last Post: 18th Mar 2024, 07:34 -
PSSH strange problem,need help
By nike1999 in forum Video Streaming DownloadingReplies: 11Last Post: 7th Aug 2023, 22:46 -
strange usb-live2 audio problem?
By jsdspif in forum CapturingReplies: 0Last Post: 2nd Mar 2023, 18:19 -
Panasonic NV-HS860 strange pictue/sync problem
By gargap in forum RestorationReplies: 0Last Post: 28th Oct 2020, 03:09