question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to only download subtitles in a specific format?

See original GitHub issue

Checklist

Question

I only want subtitles in a specific format in all languages, if there is no specific format then don’t download any subtitles.

yt-dlp -s -vU --sub-format "ass/srt" --proxy http://127.0.0.1:7890 --all-subs -- https://www.youtube.com/watch?v=YjtC7kw0SRI

But it will download vtt format.

Verbose log

[debug] Command-line config: ['-s', '-vU', '--sub-format', 'ass/srt', '--proxy', 'http://127.0.0.1:7890', '--all-subs', '--', 'https://www.youtube.com/watch?v=YjtC7kw0SRI']
[debug] Encodings: locale cp936, fs utf-8, out utf-8, err utf-8, pref cp936
[debug] yt-dlp version 2022.03.13.43044 [29003cf] (win_exe)
[debug] ** This build is unofficial daily builds, provided for ease of use.
[debug] ** Please do not ask for any support.
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.19044-SP0
[debug] exe versions: ffmpeg git-2022-02-22-570fda56 (setts), ffprobe 2022-02-21-git-b8e58f0858-essentials_build-www.gyan.dev
[debug] Optional libraries: brotli, Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {'http': 'http://127.0.0.1:7890', 'https': 'http://127.0.0.1:7890'}
Latest version: 2022.03.13.43044, Current version: 2022.03.13.43044
yt-dlp is up to date (2022.03.13.43044)
[debug] [youtube] Extracting URL: https://www.youtube.com/watch?v=YjtC7kw0SRI
[youtube] YjtC7kw0SRI: Downloading webpage
[youtube] YjtC7kw0SRI: Downloading android player API JSON
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[debug] Downloading subtitles: zh-Hans, zh-Hant, en, id
WARNING: No subtitle format found matching "ass/srt" for language zh-Hans, using vtt
WARNING: No subtitle format found matching "ass/srt" for language zh-Hant, using vtt
WARNING: No subtitle format found matching "ass/srt" for language en, using vtt
WARNING: No subtitle format found matching "ass/srt" for language id, using vtt
[debug] Default format spec: bestvideo*+bestaudio/best
[info] YjtC7kw0SRI: Downloading 1 format(s): 248+251

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Yay295commented, Jun 18, 2022

VTT and srt are basically just timed text (although VTT theoretically can hold much more - YT does not make use of those features and just includes text and timing)

Here’s a video with colored subtitles and karaoke: https://www.youtube.com/watch?v=_VIeV_LZXHM

0reactions
SalimFcommented, Jul 12, 2022

RROR: [generic] '—-convert-subs' is not a valid URL. Set --default-search "ytsearch" (or run yt-dlp "ytsearch:—-convert-subs" ) to search YouTube

Ok it’s works --convert-subs "ass"

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to download only subtitles of videos using youtube-dl
Another simple way to download subtitles from YouTube is to download Google2SRT. Google2SRT is a free, open source program for ...
Read more >
How to Download SRT Subtitle Files Online (Quick and Easy)
Upload your video to VEED and then click on 'options' and then click on the download srt files icon.
Read more >
How to Download YouTube Subtitles as Text & Transcript Files
How to download YouTube subtitles as text files · 2. Check to make sure the YouTube video has captions/subtitles added with the “CC”...
Read more >
The Easiest Way to Find & Load Subtitle (SRT) Files with Video
Finding and Downloading Subtitles ... Luckily, just about every TV Show and movie has a subtitle file created for it by some gracious...
Read more >
How to Download Subtitles/Captions in YouTube
In addition to having the videos subtitled/captions, it's a good practice is to have the subtitles readily available as a transcript in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found