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
132.49k stars 10.05k forks source link

skipping video download also skips non-video post-processing actions #9073

Open cemysce opened 8 years ago

cemysce commented 8 years ago

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.04.01. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

$ youtube-dl -v --skip-download --write-sub --convert-subs srt --all-subs https://www.youtube.com/watch?v=sLEdi49XEhA
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'--skip-download', u'--write-sub', u'--convert-subs', u'srt', u'--all-subs', u'https://www.youtube.com/watch?v=sLEdi49XEhA']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.04.01
[debug] Python version 2.7.6 - Linux-3.13.0-83-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] sLEdi49XEhA: Downloading webpage
[youtube] sLEdi49XEhA: Downloading video info webpage
[youtube] sLEdi49XEhA: Extracting video information
[youtube] sLEdi49XEhA: Downloading MPD manifest
[info] Writing video subtitles to: The Beauty of the Dinner Scene-sLEdi49XEhA.en-US.vtt
[info] Writing video subtitles to: The Beauty of the Dinner Scene-sLEdi49XEhA.en.vtt

Description of your issue, suggested solution and other information

Using the --skip-download option seems to skip post-processing options, or at least the --convert-subs option. The other post-processing options are related to the video, so it makes sense that they'd be skipped, but --skip-download is a handy feature for downloading subtitles but not the video (particularly for really large videos that you've already downloaded and don't want to download again), and post-processing options for the subtitles should be processed.

Either that, or for the sake of internal consistency, --skip-download should also skip downloading subtitles. Perhaps the ability to download subtitles but not the video was an accidental feature? Maybe --skip-download was always intended as a dry-run feature, to not download anything? Personally though, I would prefer there be some way to download just the subtitles and post-process them.

In the example command above, the video has subtitles in vtt format. Without the --skip-download option, the vtt subtitles are eventually converted to srt. However with the --skip-download option, they're left as vtt.

archangelic commented 8 years ago

Just following this because I have a bot that depends on the ability to have srt subtitles, but I have no use for the video (and I don't want to waste the bandwidth downloading the video). I would love to see this get fixed.

ghost commented 8 years ago

For now you can just call ffmpeg manually:

ffmpeg -i foo.vtt foo.srt
vxbinaca commented 8 years ago

This bug is still a bug:

youtube-dl --ignore-config --write-sub --all-subs --convert-subs "srt" --restrict-filenames --skip-download https://www.youtube.com/watch?v=uieM18rZdHY

It spits out the sub files in VTT, but doesn't convert them to SRT.

archangelic commented 8 years ago

Is it possible to call the post-processing through an API call instead of running the command line?

yan12125 commented 8 years ago

A hacky approach is to create a file with the same name as the file to download and not specifying skip_download.

yan12125 commented 8 years ago

I have created a PR at #9738. Please help test it.

NothingCanPlayVTT commented 7 years ago

nyuszika7h mentioned "ffmpeg -i foo.vtt foo.srt"

Interestingly I discovered:


youtube-dl.exe --convert-subs srt --all-subs http://www.tg4.ie/en/player/home/?pid=5270396083001

[generic] ?pid=5270396083001: Requesting header WARNING: Falling back on generic information extractor. [generic] ?pid=5270396083001: Downloading webpage [generic] ?pid=5270396083001: Extracting information [download] Downloading playlist: EIPIC | Baile | Seinnteoir | TG4 [generic] playlist EIPIC | Baile | Seinnteoir | TG4: Collected 1 video ids (downloading 1 of them) [download] Downloading video 1 of 1 [brightcove:new] 5270396083001: Downloading webpage [brightcove:new] 5270396083001: Downloading JSON metadata [brightcove:new] 5270396083001: Downloading m3u8 information [info] Writing video subtitles to: EIPIC - 4 Bea-5270396083001.en.vtt [hlsnative] Downloading m3u8 manifest [hlsnative] Total fragments: 198 [download] Destination: EIPIC - 4 Bea-5270396083001.mp4 [download] 100% of 513.23MiB in 01:43:02 WARNING: 5270396083001: malformated aac bitstream. Install ffmpeg or avconv to fix this automatically. [ffmpeg] Converting subtitles ERROR: ffmpeg or avconv not found. Please install one.

So without an external program ffmpeg also installed, getting it to save something other than VTT doesn't work.

I have K-Lite Codec pack and Media Player Classic which has ffmpeg as a DLL file but it can't be run by any youtube-dl or any other external video downloader I've tried.

vxbinaca commented 7 years ago

@NothingCanPlayVTT Cygwin and ffmpeg perhaps?

ghost commented 7 years ago

You don't need to use Cygwin. Just download Zeranoe's FFmpeg builds and put it in your PATH environment variable.

lucascaton commented 6 years ago

As of version 2018.03.26.1, this still happens:

$ youtube-dl --write-auto-sub --convert-subs=lrc --sub-lang=pt --skip-download -- xxxxxxxxxxx

[youtube] xxxxxxxxxxx: Downloading webpage
[youtube] xxxxxxxxxxx: Downloading video info webpage
[youtube] xxxxxxxxxxx: Extracting video information
[youtube] xxxxxxxxxxx: Looking for automatic captions
[youtube] xxxxxxxxxxx: Downloading MPD manifest
[youtube] xxxxxxxxxxx: Downloading MPD manifest
[info] Writing video subtitles to: video-title-xxxxxxxxxxx.pt.vtt

Subtitles are downloaded as vtt instead of lrc.


$ youtube-dl --version
2018.03.26.1