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!
+ Reply to Thread
Results 1 to 9 of 9
-
-
Right click on the mpd in dev tools. Now copy as cURL cmd or cURL bash
Convert this to python and use in your scriptCode: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'
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) -
--[----->+<]>.++++++++++++.---.--------.
[*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*] -
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?
I'm using this one:What's the video URL specifically? There are multiple bitmovin demo pages that each use dash mpd.
https://bitmovin.com/demos/drm -
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. -
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
Output: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)
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*] -
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*]
Similar Threads
-
problem with mpd , its saying [The requested URL "[no URL]", is invalid.]
By arvind_1 in forum Newbie / General discussionsReplies: 1Last Post: 4th Jul 2024, 13:37 -
Looking for the mpd url of a M6 video
By Zacki in forum Video Streaming DownloadingReplies: 35Last Post: 28th Jun 2024, 10:48 -
yt-dlp and mpd file rather than url
By ac427 in forum Video Streaming DownloadingReplies: 2Last Post: 14th Jan 2022, 11:10 -
Who can help me about this .mpd url?
By sagokey in forum Video Streaming DownloadingReplies: 9Last Post: 8th Jan 2022, 11:57 -
How to obtain mpd url and license url
By pepperx in forum Newbie / General discussionsReplies: 0Last Post: 1st Oct 2021, 16:05


Quote




