VideoHelp Forum



Support our site by donate $5 directly to us Thanks!!!

Try StreamFab Downloader and download streaming video from Netflix, Amazon!



+ Reply to Thread
Results 1 to 4 of 4
  1. Hi all,

    Is there a way to "automate" the process of retreiving mpd links ?

    I managed to get the keys of some website content, as well as the mpd links, but the mpd links changes every week for every match... The kid/keys remains the same, only the mpd links are different.

    Any clue about that ? I would like to find a way to get the mpd urls automatically, instead of replacing manually the old mpd urls by the new one every week-end.

    Thanks!
    Last edited by mathieuthibault; 14th Apr 2023 at 11:57.
    Quote Quote  
  2. psaframe
    Join Date
    Mar 2021
    Location
    Algeria
    Search PM
    Please don't subscription streaming. this thread is closed
    Quote Quote  
  3. Originally Posted by naim2007 View Post
    Please don't subscription streaming. this thread is closed
    Sorry. I edited first post, not mentionning the service. Just asking if there are ways to "automate" mpd links retreiving.
    Quote Quote  
  4. i have wrote a script in python selenium for that, the mostly tokens expires after few hours

    so as example

    i have a script where i know the mpd url are 5 hours still active. So after 4 hours i login with the script and get the new mpd url


    Code:
    desired_capabilities = DesiredCapabilities.CHROME.copy()
    logging_prefs = {'performance': 'ALL'}
    desired_capabilities['goog:loggingPrefs'] = logging_prefs
    
    browser = uc.Chrome(options=options, desired_capabilities=desired_capabilities)

    [ ... ]

    Code:
            logs = browser.get_log('performance')
            url_pattern = re.compile(r'https://license\.solocoo\.tv/wv\?c=.*')
    
            mpd_url_pattern = re.compile(r'https://nl-bks400-prod05-live.solocoo\.tv/.*\.mpd\b')

    [ ... ]


    Code:
            lic_server = None
            mpd_url = None
            for log in logs:
                try:
                    # JSON-String in ein Python-Objekt konvertieren
                    message = json.loads(log['message'])
    
    
                    if 'message' in message and url_pattern.match(message['message']['params']['request']['url']):
                        # URL aus Eintrag extrahieren und in Variable speichern
                        url = message['message']['params']['request']['url']
                        if lic_server is None and url.startswith('https://license.solocoo.tv/wv?c='):
                            lic_server = url
                    elif 'message' in message and mpd_url_pattern.match(message['message']['params']['request']['url']):
                        url2 = message['message']['params']['request']['url']
                        if 'bpk-token' in url2:
                            if '/keepalive' in url2:
                                mpd_url = url2
                            else:
                                url2 = url2.replace('.mpd','.mpd/keepalive')
                                mpd_url= url2
    
                        else:
                            mpd_url = url2
                except:
                    pass  # Fehlerhafte Einträge überspringen


    in my example, you get now the license server and the mpd. But sure you need to edit that for every site.


    EDIT:
    But if you grab new mpd links, its better than you grab the new keys too.

    So you said the keys are the same, but maybe in nearly future its change, so than you have max a down time of few hours and you dont need to do anything.

    if you dont grab the new keys you need to do it manually if change that



    EDIT 2:
    here a different way:

    Code:
            entries = browser.execute_script("return window.performance.getEntries();")
            mpd_url = None
            for entry in entries:
                try:
    
                    mpd_url_regex = re.compile(r"https://[^\s]+\.mpd")
    
                    json_entry = json.dumps(entry)
                    mpd_url_match = mpd_url_regex.search(json_entry)
                    if mpd_url_match:
                        mpd_url = mpd_url_match.group()
                        break
                except Exception as e:
                    print(e)
    Last edited by Haft66; 22nd Apr 2023 at 04:29.
    Quote Quote  



Similar Threads

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