Hello,
When checking this video
https://www.arte.tv/fr/videos/108558-001-A/comment-voulons-nous-aimer/
for available subtitles I got this:
But when I try to use any of these language codes (i.e. 'fr', 'en', etc.) in yt-dlp options in Python script, these codes aren't recognized.Code:[info] Available subtitles for 108558-001-A: Language Formats fr vtt de vtt en vtt es vtt pl vtt it vtt
Here is example of option for English:
And here is log of yt-dlp:Code:ydl_opts = {'writesubtitles': True, 'subtitleslangs': 'en', 'embed_subs': True}
Any comments ?Code:[info] 108558-001-A: Downloading 1 format(s): VF-STF-2046+VF-STF-program_audio_0-VF [info] There's no subtitles for the requested languages
Thanks.
Support our site by donate $5 directly to us Thanks!!!
Try StreamFab Downloader and download streaming video from Netflix, Amazon!
Try StreamFab Downloader and download streaming video from Netflix, Amazon!
+ Reply to Thread
Results 1 to 16 of 16
-
-
[Attachment 69235 - Click to enlarge]
Only one subtitle available and it is French. (other vtt is for thumbnails)
The master stream only offers French :-
[Attachment 69236 - Click to enlarge]
N_m3u8DL-RE https://arte-cmafhls.akamaized.net/am/cmaf/108000/108500/108558-001-A/230214111238/108...VF-STF_XQ.m3u8Last edited by A_n_g_e_l_a; 15th Feb 2023 at 03:18.
-
No !
If I don't specify the language, it's the English subtitles that are downloaded, not the French ones.
Code:(env_video_dnld) sancho_pansa@MISSURI:~/env_video_dnld$ yt-dlp https://www.arte.tv/fr/videos/108558-001-A/comment-voulons-nous-aimer/ -s --list-subs [ArteTV] Extracting URL: https://www.arte.tv/fr/videos/108558-001-A/comment-voulons-nous-aimer/ [ArteTV] 108558-001-A: Downloading JSON metadata [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [info] Available subtitles for 108558-001-A: Language Formats fr vtt de vtt de_sdh vtt en vtt es vtt pl vtt it vtt [info] 108558-001-A: Downloading 1 format(s): VF-STF-2046+VF-STF-program_audio_0-VF
Last edited by Pavel_47; 15th Feb 2023 at 03:48.
-
There are only fr subtitles available in any streams open to me from the UK.
[Attachment 69238 - Click to enlarge]
Only french is listed by N_m3u8DL-RE
No subtitles at all are listed by yt-dlp -F https://arte-cmafhls.akamaized.net/am/cmaf/108000/108500/108558-001-A/230214111238/108...VF-STF_XQ.m3u8
And yourCode:env_video_dnld) sancho_pansa@MISSURI:~/env_video_dnld$ yt-dlp https://www.arte.tv/fr/videos/108558-001-A/comment-voulons-nous-aimer/ -s --list-subs [ArteTV] Extracting URL: https://www.arte.tv/fr/videos/108558-001-A/comment-voulons-nous-aimer/ [ArteTV] 108558-001-A: Downloading JSON metadata [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [info] Available subtitles for 108558-001-A: Language Formats fr vtt de vtt de_sdh vtt en vtt es vtt pl vtt it vtt [info] 108558-001-A: Downloading 1 format(s): VF-STF-2046+VF-STF-program_audio_0-VF
I am unable to help you further finding something that appears, from the UK, to not exist.. -
I check in m3u8 there are no english subtitle m3u8 list at the bottom, only french,
Code:#EXTM3U #EXT-X-VERSION:7 #EXT-X-INDEPENDENT-SEGMENTS #EXT-X-STREAM-INF:BANDWIDTH=2261800,AVERAGE-BANDWIDTH=1128048,VIDEO-RANGE=SDR,CODECS="avc1.4d401e,mp4a.40.2",RESOLUTION=768x432,FRAME-RATE=25.000,AUDIO="program_audio_0",SUBTITLES="subs" medias/108558-001-A_v432.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=4396536,AVERAGE-BANDWIDTH=2046088,VIDEO-RANGE=SDR,CODECS="avc1.4d0028,mp4a.40.2",RESOLUTION=1920x1080,FRAME-RATE=25.000,AUDIO="program_audio_0",SUBTITLES="subs" medias/108558-001-A_v1080.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=3965488,AVERAGE-BANDWIDTH=1925416,VIDEO-RANGE=SDR,CODECS="avc1.4d401f,mp4a.40.2",RESOLUTION=1280x720,FRAME-RATE=25.000,AUDIO="program_audio_0",SUBTITLES="subs" medias/108558-001-A_v720.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1400960,AVERAGE-BANDWIDTH=729448,VIDEO-RANGE=SDR,CODECS="avc1.4d401e,mp4a.40.2",RESOLUTION=640x360,FRAME-RATE=25.000,AUDIO="program_audio_0",SUBTITLES="subs" medias/108558-001-A_v360.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=791480,AVERAGE-BANDWIDTH=430192,VIDEO-RANGE=SDR,CODECS="avc1.42e00d,mp4a.40.2",RESOLUTION=384x216,FRAME-RATE=25.000,AUDIO="program_audio_0",SUBTITLES="subs" medias/108558-001-A_v216.m3u8 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=775120,AVERAGE-BANDWIDTH=194488,VIDEO-RANGE=SDR,CODECS="avc1.4d401e",RESOLUTION=768x432,URI="medias/108558-001-A_v432_iframe_index.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=1455208,AVERAGE-BANDWIDTH=315664,VIDEO-RANGE=SDR,CODECS="avc1.4d0028",RESOLUTION=1920x1080,URI="medias/108558-001-A_v1080_iframe_index.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=1398368,AVERAGE-BANDWIDTH=313720,VIDEO-RANGE=SDR,CODECS="avc1.4d401f",RESOLUTION=1280x720,URI="medias/108558-001-A_v720_iframe_index.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=512808,AVERAGE-BANDWIDTH=131224,VIDEO-RANGE=SDR,CODECS="avc1.4d401e",RESOLUTION=640x360,URI="medias/108558-001-A_v360_iframe_index.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=198248,AVERAGE-BANDWIDTH=55168,VIDEO-RANGE=SDR,CODECS="avc1.42e00d",RESOLUTION=384x216,URI="medias/108558-001-A_v216_iframe_index.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="program_audio_0",LANGUAGE="fr",NAME="VF",AUTOSELECT=YES,DEFAULT=YES,URI="medias/108558-001-A_aud_VF-FRA_4.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="VF-FR",DEFAULT=YES,AUTOSELECT=YES,FORCED=NO,LANGUAGE="fr",URI="medias/108558-001-A_st_VF-.m3u8"
and save srt file via subtitle edit
english subtitle https://files.videohelp.com/u/301156/en.srt -
If you have Python on your PC, you can try this:
- install yt-dlp with pip
- execute the following small script
Code:import yt_dlp link = ['https://www.arte.tv/fr/videos/108558-001-A/comment-voulons-nous-aimer/'] ydl_opts = {'skip_download': True, 'writesubtitles': True} with yt_dlp.YoutubeDL(ydl_opts) as ydl: ydl.download(link)
P.S. In the title of this post the keyword is "Python". I'm looking for a solution with Python, NOT with other tools -
To emulate another environment, maybe just change the language here...
https://i.postimg.cc/28tkXm4h/Screenshot-from-2023-02-15-12-50-19.png -
-
I have already told you I only see ONE subtitle offered.
Code:yt-dlp https://www.arte.tv/fr/videos/108558-001-A/comment-voulons-nous-aimer/ -s --list-subs [ArteTV] 108558-001-A: Downloading JSON metadata [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [ArteTV] 108558-001-A: Downloading m3u8 information [info] Available subtitles for 108558-001-A: Language Formats fr vtt de vtt, vtt en vtt es vtt pl vtt it vtt [info] 108558-001-A: Downloading 1 format(s): VF-STF-2046+VF-STF-program_audio_0-VF
-
I asked you to try "WITH MY METHOD" i.e. using yt-dlp ... as yt-dlp (along with Python) was one of keywords of title.
If you can't, no problem.
BTW, yt-dlp request displays 6 languages: 'fr', 'en', 'de', 'es', 'pl', 'it' ... not just one.
Perhaps the method you use for checking subtitles just CAN'T access to all subtitles. -
Just what is the problem? You do not want English subtitles which seems to be your default. N_m3u8DL-RE downloads subtitles in French, which I assume you do want, so use N_m3u8DL-RE. Case closed.
If you want only to use python then wrap the command for N_m3u8DL-RE inside an os.system call.
If you think you have a problem with yt-dlp then ask here https://discord.gg/tvDChKtK -
-
What I want, is quite explicitly mentioned in the title:
Language code for subtitles in Python script for yt-dlp
My request assumes that I already know how to download subtitles, but facing a language code problem. In the 1st post of this thread, I explained the problem in more detail: although I specify a correct language code (e.g. "en", fr", etc.), yt-dlp is not able to recognize it. When I don't specify the language code at all, but ask to download subtitles, the English subtitles (i.e. 'en') are downloaded
Well, in short, my request was not intended to be understood as follows:
I want to know how to download subtitle file from website
Sincerely. -
-
The problem resolved !
The language code(s) must be list object, i.e. instead of
Code:ydl_opts = {'writesubtitles': True, 'subtitleslangs': 'en', 'embed_subs': True}
Code:ydl_opts = {'writesubtitles': True, 'subtitleslangs': ['en'], 'embed_subs': True}
Similar Threads
-
How to get the widevine pssh from init mp4 JUST using python script?
By ancientbanana in forum Video Streaming DownloadingReplies: 14Last Post: 20th Nov 2024, 11:57 -
yt-dlp in Python
By blanc in forum Video Streaming DownloadingReplies: 1Last Post: 4th Jan 2023, 05:37 -
trying to get yt-dlp module for Python
By Skaperen in forum LinuxReplies: 3Last Post: 15th Jun 2022, 11:12 -
how to pipe:/// through a .sh or Python script, or use some sort of setting
By netspud2k in forum LinuxReplies: 1Last Post: 4th Mar 2020, 19:48 -
Help Needed With Python ffprobe Script
By chris319 in forum ProgrammingReplies: 11Last Post: 28th Jun 2019, 10:15