Python Forum
How to find link to video file from URL - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: How to find link to video file from URL (/thread-37191.html)

Pages: 1 2 3 4


How to find link to video file from URL - Pavel_47 - May-10-2022

Hello,

There is Add-on in FireFox (Video DownloadHelper) that allows to find link to video.
For example on this page Planète Californie
the links to video and audio streams are:

https://arte-cmafhls.akamaized.net/am/cmaf/093000/093600/093640-002-A/220501061401/medias/093640-002-A_v720.mp4
https://arte-cmafhls.akamaized.net/am/cmaf/093000/093600/093640-002-A/220501061401/medias/093640-002-A_aud_VF.mp4

Browsing through the entire page, you cannot find these links.
Any ideas how to do it using let's say BeautifulSoup.
Thanks.


RE: How to find link to video file from URL - Larz60+ - May-11-2022

try accessing this site manually.
When I try, I get: This video is not available in your country. (but in french)


RE: How to find link to video file from URL - Pavel_47 - May-11-2022

(May-11-2022, 12:45 AM)Larz60+ Wrote: try accessing this site manually.
When I try, I get: This video is not available in your country. (but in french)

I can access it manually. The problem is to find on the page the link to video content in order to download it.


RE: How to find link to video file from URL - Axel_Erfurt - May-11-2022

Arte is france/germany, you can try mediathekviewweb to find french movies in arte

https://mediathekviewweb.de/#query=Plan%C3%A8te%20Californie


RE: How to find link to video file from URL - Pavel_47 - May-11-2022

Well... the problem is not getting that particular video, but understanding the principle of accessing the video file from the url.
Here is video that should be accessible from everywhere:
https://www.arte.tv/fr/videos/103960-023-A/le-dessous-des-cartes/

and here is video and audio stream that it used:
https://arte-cmafhls.akamaized.net/am/cmaf/103000/103900/103960-023-A/220428065559/medias/103960-023-A_v720.mp4
https://arte-cmafhls.akamaized.net/am/cmaf/103000/103900/103960-023-A/220428065559/medias/103960-023-A_aud_VOF.mp4

By merely searching the site, these files cannot be found.


RE: How to find link to video file from URL - DeaD_EyE - May-11-2022

The problem is, that requesting a Video requires a valid session (Cookie and Authkey).
Maybe it's easier to use selenium. Otherwise, you've to reverse engineer the way how authorization works on this page.


RE: How to find link to video file from URL - Pavel_47 - May-11-2022

(May-11-2022, 01:51 PM)DeaD_EyE Wrote: The problem is, that requesting a Video requires a valid session (Cookie and Authkey).
Maybe it's easier to use selenium. Otherwise, you've to reverse engineer the way how authorization works on this page.

Regarding cookies not sure...maybe yes, but sure there is no authentication key.
This video is available for everyone everywhere.


RE: How to find link to video file from URL - Axel_Erfurt - May-11-2022

Maybe you can understand how the yt-dlp arte extractor does it.


RE: How to find link to video file from URL - snippsat - May-11-2022

(May-11-2022, 02:04 PM)Pavel_47 Wrote: Regarding cookies not sure...maybe yes, but sure there is no authentication key.
This video is available for everyone everywhere.
What's talked about here is site internal authorization before site get videos from the external Akamai (used bye lot Tv/Stream site for media delivery).
If site has API then is the easiest way,if look at arte.py from yt-dlp a youtube-dl fork.
Then see that they use the API https://api.arte.tv/api/player/v1,but dos not seems to work anymore.
So arte.tv can have made internal changes or changes there API.
G:\1_youtube
λ yt-dlp.exe https://www.arte.tv/en/videos/101139-020-A/360-geo/
[ArteTV] 101139-020-A: Downloading JSON metadata
ERROR: [ArteTV] 101139-020-A: Unable to download JSON metadata: HTTP Error 404:
Not Found (caused by <HTTPError 404: 'Not Found'>);
please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template.
Confirm you are on the latest version using  yt-dlp -U
I have done a lot with this in past and still maintain(done it for 10-years) a Norwegian Tv download(GUI app) that get video's from Akamai.
There has been us and downs reverse engineer all changes they made trough the years,
they got an API about 5-years ago that did make it a little easier.


RE: How to find link to video file from URL - Axel_Erfurt - May-11-2022

For the arte problem with yt-dlp there is a fix (The pull request has not yet been accepted.)

https://raw.githubusercontent.com/fstirlitz/yt-dlp/arte-v2/yt_dlp/extractor/arte.py