VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. Hello all,

    I am trying to write a Python programme that will automatically determine the MPD URL. Can someone please indicate how to get this information from the Developer Tools for the Bitmovin demo? I can see the actual MPD URL in the tools window but I can't find the request that provides the URL in the first place. Thanks!
    Quote Quote  
  2. Right click on the mpd in dev tools. Now copy as cURL cmd or cURL bash


    Code:
    curl 'https://cdn.bitmovin.com/content/assets/art-of-motion_drm/mpds/11331.mpd' \
      -H 'accept: */*' \
      -H 'accept-language: en-US,en;q=0.9' \
      -H 'cache-control: no-cache' \
      -H 'origin: https://bitmovin.com' \
      -H 'pragma: no-cache' \
      -H 'priority: u=1, i' \
      -H 'referer: https://bitmovin.com/' \
      -H 'sec-ch-ua: "Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'sec-ch-ua-platform: "Windows"' \
      -H 'sec-fetch-dest: empty' \
      -H 'sec-fetch-mode: cors' \
      -H 'sec-fetch-site: same-site' \
      -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36'
    Convert this to python and use in your script


    use https://curlconverter.com/

    Code:
    import requests
    
    headers = {
        'accept': '*/*',
        'accept-language': 'en-US,en;q=0.9',
        'cache-control': 'no-cache',
        'origin': 'https://bitmovin.com',
        'pragma': 'no-cache',
        'priority': 'u=1, i',
        'referer': 'https://bitmovin.com/',
        'sec-ch-ua': '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"',
        'sec-ch-ua-mobile': '?0',
        'sec-ch-ua-platform': '"Windows"',
        'sec-fetch-dest': 'empty',
        'sec-fetch-mode': 'cors',
        'sec-fetch-site': 'same-site',
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36',
    }
    
    response = requests.get('https://cdn.bitmovin.com/content/assets/art-of-motion_drm/mpds/11331.mpd', headers=headers)
    Quote Quote  
  3. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by Sitz View Post
    Can someone please indicate how to get this information from the Developer Tools for the Bitmovin demo?
    What's the video URL specifically? There are multiple bitmovin demo pages that each use dash mpd.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  4. Originally Posted by Gromyko View Post
    Right click on the mpd in dev tools. Now copy as cURL cmd or cURL bash


    Code:
    curl 'https://cdn.bitmovin.com/content/assets/art-of-motion_drm/mpds/11331.mpd' \
      -H 'accept: */*' \
      -H 'accept-language: en-US,en;q=0.9' \
      -H 'cache-control: no-cache' \
      -H 'origin: https://bitmovin.com' \
      -H 'pragma: no-cache' \
      -H 'priority: u=1, i' \
      -H 'referer: https://bitmovin.com/' \
      -H 'sec-ch-ua: "Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'sec-ch-ua-platform: "Windows"' \
      -H 'sec-fetch-dest: empty' \
      -H 'sec-fetch-mode: cors' \
      -H 'sec-fetch-site: same-site' \
      -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36'
    Convert this to python and use in your script


    use https://curlconverter.com/

    Code:
    import requests
    
    headers = {
        'accept': '*/*',
        'accept-language': 'en-US,en;q=0.9',
        'cache-control': 'no-cache',
        'origin': 'https://bitmovin.com',
        'pragma': 'no-cache',
        'priority': 'u=1, i',
        'referer': 'https://bitmovin.com/',
        'sec-ch-ua': '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"',
        'sec-ch-ua-mobile': '?0',
        'sec-ch-ua-platform': '"Windows"',
        'sec-fetch-dest': 'empty',
        'sec-fetch-mode': 'cors',
        'sec-fetch-site': 'same-site',
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36',
    }
    
    response = requests.get('https://cdn.bitmovin.com/content/assets/art-of-motion_drm/mpds/11331.mpd', headers=headers)
    Thanks for the information. But if I didn't inspect the Developer Tools, how would I know that 11331.mpd is the correct MPD? Which browser request informs the browser that 11331.mpd is to be used in the first place?

    What's the video URL specifically? There are multiple bitmovin demo pages that each use dash mpd.
    I'm using this one:

    https://bitmovin.com/demos/drm
    Quote Quote  
  5. You'd have you emulate a full blown browser include javascript engine to find out. There is probably no generell solution for this task (except probaly you are coding a browser plugin).

    All download tools I'm aware of work differently (i.e. not acting like a browser): the developer analyzes beforehand what urls the browser requests and picks the specifically important requests for his code. Usually only a fraction of the requests a browser makes is necessary to find the mpd url.

    Take a look at how widefrog/Devine/yt-dlp/freevine/Kodi (python tools) work, and compare with how Widevine-Guesser/WidevineProxy2 (browser plugins) work on the other side.
    Quote Quote  
  6. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by Sitz View Post
    I'm using this one:

    https://bitmovin.com/demos/drm
    Like @obo said, there aint a general solution. If, for some reason, you want a specific solution for this website, here's a trivial script

    Code:
    import requests
    from bs4 import BeautifulSoup
    
    SOURCE_URL = "https://bitmovin.com/demos/drm"
    
    
    def get_mpd(source_url):
        response = requests.get(source_url).text
        response = BeautifulSoup(response, 'html.parser')
        response = response.find_all('span', class_=lambda x: x and 'hljs-string' in x)
        manifest = None
    
        for span in response:
            try:
                manifest = span.getText().strip()
                manifest = manifest.replace("'", "")
                manifest = manifest.replace('"', "")
                assert ".mpd" in manifest
            except:
                manifest = None
                continue
            if manifest is not None:
                break
    
        print(manifest)
    
    
    if __name__ == '__main__':
        get_mpd(SOURCE_URL)
    Output:
    Code:
    https://cdn.bitmovin.com/content/assets/art-of-motion_drm/mpds/11331.mpd
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  7. Originally Posted by Obo View Post
    You'd have you emulate a full blown browser include javascript engine to find out. There is probably no generell solution for this task (except probaly you are coding a browser plugin).

    All download tools I'm aware of work differently (i.e. not acting like a browser): the developer analyzes beforehand what urls the browser requests and picks the specifically important requests for his code. Usually only a fraction of the requests a browser makes is necessary to find the mpd url.

    Take a look at how widefrog/Devine/yt-dlp/freevine/Kodi (python tools) work, and compare with how Widevine-Guesser/WidevineProxy2 (browser plugins) work on the other side.
    Thanks for the insight, much appreciated.
    Quote Quote  
  8. How to get mpd link without watching being video?

    Could someone explain?
    Quote Quote  
  9. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    You get mpd link without interacting with the page, by writing a script
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  



Similar Threads

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