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
#11
(May-11-2022, 06:10 PM)Axel_Erfurt Wrote: 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
Thanks.
But after installing yt-dlp in my Ubuntu machine I couldn't find arte.py.
Where python files are located ?
Reply
#12
(May-12-2022, 10:57 AM)Pavel_47 Wrote: But after installing yt-dlp in my Ubuntu machine I couldn't find arte.py
Where python files are located ?
The default downloads of yt-dlp is a binary file then you will not find anything.
The easiest way to upgrade to the new arte.py file is to use pip(you can install yt-dlp with pip).

Make a virtual environment and install.
Example.
tom@tom-VirtualBox:~$ python -m venv arte_env
tom@tom-VirtualBox:~$ cd arte_env/
tom@tom-VirtualBox:~/arte_env$ source bin/activate
(arte_env) tom@tom-VirtualBox:~/arte_env$ pip install yt-dlp
Collecting yt-dlp
.....  
Successfully installed brotli-1.0.9 certifi-2021.10.8 mutagen-1.45.1 pycryptodomex-3.14.1 websockets-10.3 yt-dlp-2022.4.8  

(arte_env) tom@tom-VirtualBox:~/arte_env$ ls
bin  include  lib  lib64  pyvenv.cfg  share
So at this point i go into lib64 eg for me arte_env/lib64/python3.10/site-packages/yt_dlp/extractor/arte.py
Replace all content with file from Axel_Erfurt post and save.
Then go into bin folder and test that it work.
(arte_env) tom@tom-VirtualBox:~/arte_env$ cd bin
(arte_env) tom@tom-VirtualBox:~/arte_env/bin$ ls
activate      activate.fish  mid3cp     mid3v2     mutagen-inspect  pip   pip3.10  python3     yt-dlp
activate.csh  Activate.ps1   mid3iconv  moggsplit  mutagen-pony     pip3  python   python3.10
(arte_env) tom@tom-VirtualBox:~/arte_env/bin$ yt-dlp https://www.arte.tv/en/videos/101139-013-A/geo-reportage/
[ArteTV] 101139-013-A: Downloading JSON metadata
[ArteTV] 101139-013-A: Downloading m3u8 information
[ArteTV] 101139-013-A: Downloading m3u8 information
[ArteTV] 101139-013-A: Downloading m3u8 information
[ArteTV] 101139-013-A: Downloading m3u8 information
[ArteTV] 101139-013-A: Downloading m3u8 information
[ArteTV] 101139-013-A: Downloading m3u8 information
[ArteTV] 101139-013-A: Downloading m3u8 information
[ArteTV] 101139-013-A: Downloading m3u8 information
[info] 101139-013-A: Downloading 1 format(s): VOEU-STE_ANG_-2328+VOEU-STE_ANG_-program_audio_0-VOEU
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 322
[download] Destination: Geo Reportage [101139-013-A].fVOEU-STE_ANG_-2328.mp4
[download] 100% of 1011.63MiB in 07:03
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 322
[download] Destination: Geo Reportage [101139-013-A].fVOEU-STE_ANG_-program_audio_0-VOEU.mp4
[download] 100% of 59.97MiB in 03:43
[Merger] Merging formats into "Geo Reportage [101139-013-A].mp4"
From a Python file it will be like this.
import yt_dlp

ydl_opts = {}
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
    ydl.download(['https://www.arte.tv/en/videos/101139-013-A/geo-reportage/'])
Pavel_47 likes this post
Reply
#13
Works !
Thanks.
The only question: why create a virtual environment ?
Just to find/replace arte.py ?
Reply
#14
(May-12-2022, 01:56 PM)Pavel_47 Wrote: The only question: why create a virtual environment ?
Just to find/replace arte.py ?
It make easier to find arte.py,but then main reason is to keep it sperate of what have you installed before.
This will avoid conflicts and get all the new package's that yt_dlp need.
Also when the have updated yt_dlp then can just install it normal with pip or use binary on OS.
Then there will be no conflict as virtual environment is complete sperate to all other OS stuff,
aslo if don't need the virtual environment anymore can just delete the folder arte_env.
Reply
#15
(May-12-2022, 02:39 PM)snippsat Wrote: It make easier to find arte.py,but then main reason is to keep it sperate of what have you installed before.
This will avoid conflicts and get all the new package's that yt_dlp need.
Also when the have updated yt_dlp then can just install it normal with pip or use binary on OS.
Then there will be no conflict as virtual environment is complete sperate to all other OS stuff,
aslo if don't need the virtual environment anymore can just delete the folder arte_env.
Ok, clear.
I just discovered another problem with the tool: it doesn't take subtitles into account.
Some videos have subtitles, but downloaded files do not.
Reply
#16
Well ... there are options to embed subtitles:
--write-subs ... write subtitle file (not sure if it's needed if embed-subs is selected)
--embed-subs ... embed subtitle file
--sub-langs "fr" ... select language (french in this case)

I've tried to include this staff int ydl_opt, but got errors.
Any suggestions ?
Reply
#17
(May-12-2022, 03:25 PM)Pavel_47 Wrote: Some videos have subtitles, but downloaded files do not.
You most look at Doc Subtitle Options
yt-dlp https://www.arte.tv/en/videos/101139-013-A/geo-reportage/ --write-sub
Reply
#18
(May-12-2022, 04:11 PM)snippsat Wrote:
(May-12-2022, 03:25 PM)Pavel_47 Wrote: Some videos have subtitles, but downloaded files do not.
You most look at Doc Subtitle Options
yt-dlp https://www.arte.tv/en/videos/101139-013-A/geo-reportage/ --write-sub
Yes, I've found subtitle-related options and already tried them.
Doesn't work !
Here is log:
Output:
(arte_env) pavel@ALABAMA:~/arte_env$ yt-dlp --embed-subs --sub-langs "fr" https://www.arte.tv/fr/videos/104769-000-A/antonio-banderas-et-pedro-almodovar/ [ArteTV] 104769-000-A: Downloading JSON metadata [ArteTV] 104769-000-A: Downloading m3u8 information [ArteTV] 104769-000-A: Downloading m3u8 information [ArteTV] 104769-000-A: Downloading m3u8 information [ArteTV] 104769-000-A: Downloading m3u8 information [ArteTV] 104769-000-A: Downloading m3u8 information [ArteTV] 104769-000-A: Downloading m3u8 information [info] 104769-000-A: Downloading 1 format(s): VOF-STF-2323+VOF-STF-program_audio_0-VOF [info] Writing video subtitles to: Antonio Banderas et Pedro Almodovar [104769-000-A].fr.vtt [hlsnative] Downloading m3u8 manifest [hlsnative] Total fragments: 1 [download] Destination: Antonio Banderas et Pedro Almodovar [104769-000-A].fr.vtt [download] 100% of 95.78KiB in 00:00 [hlsnative] Downloading m3u8 manifest [hlsnative] Total fragments: 525 [download] Destination: Antonio Banderas et Pedro Almodovar [104769-000-A].fVOF-STF-2323.mp4 [download] 100% of 1.61GiB in 06:26 [hlsnative] Downloading m3u8 manifest [hlsnative] Total fragments: 526 [download] Destination: Antonio Banderas et Pedro Almodovar [104769-000-A].fVOF-STF-program_audio_0-VOF.mp4 [download] 100% of 97.99MiB in 01:59 [Merger] Merging formats into "Antonio Banderas et Pedro Almodovar [104769-000-A].mp4" Deleting original file Antonio Banderas et Pedro Almodovar [104769-000-A].fVOF-STF-2323.mp4 (pass -k to keep) Deleting original file Antonio Banderas et Pedro Almodovar [104769-000-A].fVOF-STF-program_audio_0-VOF.mp4 (pass -k to keep) [EmbedSubtitle] Embedding subtitles in "Antonio Banderas et Pedro Almodovar [104769-000-A].mp4" Deleting original file Antonio Banderas et Pedro Almodovar [104769-000-A].fr.vtt (pass -k to keep) (arte_env) pavel@ALABAMA:~/arte_env$
When I play file, there is no any subtitles.
Reply
#19
Tell the player to show subs.
Reply
#20
Most also write to file.
--embed-subs --write-sub --sub-langs "fr"
An other option is:
yt-dlp https://www.arte.tv/en/videos/101139-013-A/geo-reportage/ --write-sub
It work,make Geo Reportage [101139-013-A].en.vtt file.
Most video player find this .vtt(sub-title file) automatic as eg VLC.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How find link element zinho 3 3,135 Mar-31-2020, 12:29 PM
Last Post: snippsat
  get link and link text from table metulburr 5 6,308 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