Python Forum
How to find link to video file from URL
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to find link to video file from URL
#1
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/cm...A_v720.mp4
https://arte-cmafhls.akamaized.net/am/cm...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.
Reply
#2
try accessing this site manually.
When I try, I get: This video is not available in your country. (but in french)
Reply
#3
(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.
Reply
#4
Arte is france/germany, you can try mediathekviewweb to find french movies in arte

https://mediathekviewweb.de/#query=Plan%...Californie
Reply
#5
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...es-cartes/

and here is video and audio stream that it used:
https://arte-cmafhls.akamaized.net/am/cm...A_v720.mp4
https://arte-cmafhls.akamaized.net/am/cm...ud_VOF.mp4

By merely searching the site, these files cannot be found.
Reply
#6
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.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#7
(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.
Reply
#8
Maybe you can understand how the yt-dlp arte extractor does it.
Reply
#9
(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.
Reply
#10
For the arte problem with yt-dlp there is a fix (The pull request has not yet been accepted.)

https://raw.githubusercontent.com/fstirl...or/arte.py
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How find link element zinho 3 3,117 Mar-31-2020, 12:29 PM
Last Post: snippsat
  get link and link text from table metulburr 5 6,276 Jun-13-2019, 07:50 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020