ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
130.46k stars 9.85k forks source link

--convert-subs only works if you don't put --skip-download #26781

Closed hamidb80 closed 3 years ago

hamidb80 commented 3 years ago

I considered that --convert-subs <FORMAT> not working if put --skip-download in the command.

youtube-dl https://www.youtube.com/watch?v=48sCx-wBs34 --convert-subs srt --write-auto-sub --sub-langs en  --skip-download

But if I download video with subtitle, it converts subtitle to given format perfectly.

youtube-dl https://www.youtube.com/watch?v=48sCx-wBs34 --convert-subs srt --write-auto-sub --sub-langs en  -f worst
albino1 commented 3 years ago

This is still a thing. The subtitles download, but don't convert as it seems to exit or skip ffmpeg before the conversion would happen, I assume since there's no video for ffmpeg to theoretically interact with.

Current version:

youtube-dl.exe --version
2021.04.01

Here's an easy example file:

https://vimeo.com/358296408

Using --skip-download results in just the three vtt files and no srt conversion:

youtube-dl.exe --all-subs --convert-subs srt --skip-download https://vimeo.com/358296408
[vimeo] 358296408: Downloading webpage
[vimeo] 358296408: Extracting information
[vimeo] 358296408: Downloading JSON metadata
[vimeo] 358296408: Downloading JSON metadata
[vimeo] 358296408: Checking Original video URL
[vimeo] 358296408: Downloading fastly_skyfire m3u8 information
[vimeo] 358296408: Downloading fastly_skyfire m3u8 information
[vimeo] 358296408: Downloading akfire_interconnect_quic m3u8 information
[vimeo] 358296408: Downloading akfire_interconnect_quic m3u8 information
[vimeo] 358296408: Downloading fastly_skyfire MPD information
[vimeo] 358296408: Downloading fastly_skyfire MPD information
[vimeo] 358296408: Downloading akfire_interconnect_quic MPD information
[vimeo] 358296408: Downloading akfire_interconnect_quic MPD information
[info] Writing video subtitles to: Subtitles and captions overview-358296408.pt.vtt
[info] Writing video subtitles to: Subtitles and captions overview-358296408.en.vtt
[info] Writing video subtitles to: Subtitles and captions overview-358296408.fr.vtt

Not using --skip-download downloads the three vtt files and then converts them to srt at the cost of having to also download the full video:

youtube-dl.exe --all-subs --convert-subs srt https://vimeo.com/358296408
[vimeo] 358296408: Downloading webpage
[vimeo] 358296408: Extracting information
[vimeo] 358296408: Downloading JSON metadata
[vimeo] 358296408: Downloading JSON metadata
[vimeo] 358296408: Checking Original video URL
[vimeo] 358296408: Downloading akfire_interconnect_quic m3u8 information
[vimeo] 358296408: Downloading akfire_interconnect_quic m3u8 information
[vimeo] 358296408: Downloading fastly_skyfire m3u8 information
[vimeo] 358296408: Downloading fastly_skyfire m3u8 information
[vimeo] 358296408: Downloading akfire_interconnect_quic MPD information
[vimeo] 358296408: Downloading akfire_interconnect_quic MPD information
[vimeo] 358296408: Downloading fastly_skyfire MPD information
[vimeo] 358296408: Downloading fastly_skyfire MPD information
[info] Writing video subtitles to: Subtitles and captions overview-358296408.pt.vtt
[info] Writing video subtitles to: Subtitles and captions overview-358296408.fr.vtt
[info] Writing video subtitles to: Subtitles and captions overview-358296408.en.vtt
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 13
[download] Destination: Subtitles and captions overview-358296408.fhls-fastly_skyfire_sep-1728.mp4
[download] 100% of 14.40MiB in 00:00
[dashsegments] Total fragments: 14
[download] Destination: Subtitles and captions overview-358296408.fdash-fastly_skyfire_sep-audio-b27a1bb0.m4a
[download] 100% of 2.42MiB in 00:00
[ffmpeg] Merging formats into "Subtitles and captions overview-358296408.mp4"
Deleting original file Subtitles and captions overview-358296408.fhls-fastly_skyfire_sep-1728.mp4 (pass -k to keep)
Deleting original file Subtitles and captions overview-358296408.fdash-fastly_skyfire_sep-audio-b27a1bb0.m4a (pass -k to keep)
[ffmpeg] Converting subtitles
Deleting original file Subtitles and captions overview-358296408.pt.vtt (pass -k to keep)
Deleting original file Subtitles and captions overview-358296408.fr.vtt (pass -k to keep)
Deleting original file Subtitles and captions overview-358296408.en.vtt (pass -k to keep)
ghost commented 3 years ago

It is implemented that way https://github.com/ytdl-org/youtube-dl/issues/4954#issuecomment-76536019