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
129.94k stars 9.8k forks source link

YouTube --write-info-json only writes info on available automatic subtitles if they have been downloaded #20520

Open peteruhrig opened 5 years ago

peteruhrig commented 5 years ago

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

Before submitting an issue make sure you have:

What is the purpose of your issue?


Output:

kermit@frog:/yt$ youtube-dl --skip-download -o "%(id)s.mp4" --write-info-json --all-subs -v https://www.youtube.com/watch?v=bdkXTKZNlSo
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--skip-download', '-o', '%(id)s.mp4', '--write-info-json', '--all-subs', '-v', 'https://www.youtube.com/watch?v=bdkXTKZNlSo']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.03.18
[debug] Python version 3.5.2 (CPython) - Linux-4.4.0-138-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: ffmpeg 2.8.15, ffprobe 2.8.15
[debug] Proxy map: {}
[youtube] bdkXTKZNlSo: Downloading webpage
[youtube] bdkXTKZNlSo: Downloading video info webpage
WARNING: video doesn't have subtitles
[debug] Default format spec: bestvideo+bestaudio/best
[info] Writing video description metadata as JSON to: bdkXTKZNlSo.info.json
...
<end of log>

Section automatic_captions is empty in info.json

With the command given above, the section automatic_captions remains empty in the info.json file (see attachment). It will be filled if I run the following command:

kermit@frog:/yt$ youtube-dl --skip-download -o "%(id)s.mp4" --write-info-json --all-subs --write-auto-sub -v https://www.youtube.com/watch?v=bdkXTKZNlSo

However, this will download 104 subtitle files I do not want. My plan is to download the JSON file first and then decide on the basis of available subtitles and video resolutions whether I want to download the video and which video format to request. But it appears I cannot do this at the moment. In short: If --all-subs is switched on, I would expect the automatic_captions section to be populated in the info.json.

Thanks and best wishes, Peter

EDIT: Adding --list-subs does not do the trick either. Then it does not write the info.json.

jgalp commented 5 years ago

Is this a valid issue and is anyone working on it? I am a student at the University of Michigan looking to contribute to an open source project for my upper level software engineering class.