VideoHelp Forum


Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!


Try StreamFab Downloader and download streaming video from Youtube, Netflix, Amazon! Download free trial.


+ Reply to Thread
Results 1 to 15 of 15
Thread
  1. 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 url
    Code:
    https://www.rsi.ch/play/tv/-/video/calcio-uefa-euro-2024-turchia-georgia?urn=urn:swisstxt:video:rsi:1771876
    Inspecting I easily found .m3u8, that 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
    It 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.
    Thank you very, very much, for all your kind help and precious advices. Have a great evening
    Last edited by misiek1963; 19th Jun 2024 at 14:25.
    Quote Quote  
  2. Member aqzs's Avatar
    Join Date
    Mar 2024
    Location
    Paris
    Search Comp PM
    Make sure to grab the all m3u8 url. I had no issue downloading :
    Image
    [Attachment 80035 - Click to enlarge]
    Quote Quote  
  3. Originally Posted by aqzs View Post
    Make sure to grab the all m3u8 url. I had no issue downloading :
    Image
    [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
    so it is the complete one. I don't understand the reason I can't download and I get this error. I'm not based in Switzerland, so I use a vpn. Are you located in Switzerland, so you haven't to use one?
    Quote Quote  
  4. Member aqzs's Avatar
    Join Date
    Mar 2024
    Location
    Paris
    Search Comp PM
    Originally Posted by misiek1963 View Post
    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
    so it is the complete one. I don't understand the reason I can't download and I get this error. I'm not based in Switzerland, so I use a vpn. Are you located in Switzerland, so you haven't to use one?
    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
    Quote Quote  
  5. Originally Posted by aqzs View Post
    Originally Posted by misiek1963 View Post
    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
    so it is the complete one. I don't understand the reason I can't download and I get this error. I'm not based in Switzerland, so I use a vpn. Are you located in Switzerland, so you haven't to use one?
    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
    Thank you so much for answer and file. Video plays in browser without problems. May you write the .m3u8 url you use?
    Quote Quote  
  6. Member aqzs's Avatar
    Join Date
    Mar 2024
    Location
    Paris
    Search Comp PM
    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
    Take a look at the json loadded :
    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",
    Quote Quote  
  7. Originally Posted by aqzs View Post
    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
    Take a look at the json loadded :
    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?
    Quote Quote  
  8. Member aqzs's Avatar
    Join Date
    Mar 2024
    Location
    Paris
    Search Comp PM
    Originally Posted by misiek1963 View Post
    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?
    My link have probably expired or is ip blocked. I'll write a small script to get the link tomorrow. I use windscribe vpn.
    Quote Quote  
  9. Originally Posted by aqzs View Post
    Originally Posted by misiek1963 View Post
    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?
    My link have probably expired or is ip blocked. I'll write a small script to get the link tomorrow. I use windscribe vpn.
    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
    Quote Quote  
  10. Member aqzs's Avatar
    Join Date
    Mar 2024
    Location
    Paris
    Search Comp PM
    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 : adding -H 'X-Forwarded-For : 37.120.213.171' to the download command allow to bypass geo restriction. No vpn needed anymore ! You just have to run the script, past you video url and download using the provided command !

    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.
    Quote Quote  
  11. Originally Posted by aqzs View Post
    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 : adding -H 'X-Forwarded-For : 37.120.213.171' to the download command allow to bypass geo restriction. No vpn needed anymore ! You just have to run the script, past you video url and download using the provided command !

    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.")
    I don't know how to thank you for all efforts you put into this challenge . I've tested your script, without vpn and with vpn, too, but I get all the time the 403 (Forbidden) error. I can't figure out why this is happening
    Quote Quote  
  12. Originally Posted by misiek1963 View Post
    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
    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'
    xx.xx.xx.xx is the IP your terminal is using.

    Edit:
    Originally Posted by aqzs View Post
    edit n°2 : it seems like the token is even useless ! This tiny script should do the job :
    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.
    Quote Quote  
  13. Originally Posted by white_snake View Post
    Originally Posted by misiek1963 View Post
    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
    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'
    xx.xx.xx.xx is the IP your terminal is using.

    Edit:
    Originally Posted by aqzs View Post
    edit n°2 : it seems like the token is even useless ! This tiny script should do the job :
    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.
    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
    So the problem shouldn't be this, I think
    Quote Quote  
  14. Member aqzs's Avatar
    Join Date
    Mar 2024
    Location
    Paris
    Search Comp PM
    Originally Posted by white_snake View Post
    Originally Posted by aqzs View Post
    edit n°2 : it seems like the token is even useless ! This tiny script should do the job :
    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.
    Indeed, I don't know why it worked for one. So the first script I send is the one to use ! No vpn needed too, the api doesn't check ip if is swiss or not and adding -H 'x-forwarded-for swiss IP' bypass geoblock.
    Quote Quote  
  15. Originally Posted by aqzs View Post
    Originally Posted by white_snake View Post
    Originally Posted by aqzs View Post
    edit n°2 : it seems like the token is even useless ! This tiny script should do the job :
    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.
    Indeed, I don't know why it worked for one. So the first script I send is the one to use ! No vpn needed too, the api doesn't check ip if is swiss or not and adding -H 'x-forwarded-for swiss IP' bypass geoblock.
    Tried with all forms of the script, with and without vpn, with absolutely no avail, all the time error 403. I really don't understand the reason, video is unencrypted and playable in browser. Weird...
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!