Skip to content

Download all locales #14

@davelab6

Description

@davelab6

I noticed when checking out https://www.youtube.com/watch?v=IEfx30qHU50 that was recommended in the GE Patreon chat, that it is in Italian, but the autogenerated subtitles are also available in dozens of other languages:

Image

It appears https://github.com/yt-dlp/yt-dlp can list these per video like this

yt-dlp --list-subs "https://www.youtube.com/watch?v=Ja9dTjY3uWU"

and this command will download everything:

yt-dlp --update ;
yt-dlp \
 --yes-playlist \
 --write-subs \
 --write-auto-subs \
 --all-subs \
 --sub-format "best" \
 --convert-subs vtt \
 --skip-download \
 --no-overwrites --continue --ignore-errors \
 --download-archive downloaded.txt \
 --sleep-interval 30 --max-sleep-interval 300 \
 --retries infinite --fragment-retries infinite \
 --rate-limit 0.1M --throttled-rate 0.05M \
 --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0 Safari/537.36" \
 -4 \
 -o "%(id)s.%(ext)s" \
 "https://www.youtube.com/@garyseconomics" ;
Option Purpose
--yes-playlist Ensures yt-dlp processes the whole playlist or channel
--write-subs Download manually uploaded subtitles
--write-auto-subs Also download auto-generated captions
--all-subs Downloads all available subtitle languages
--sub-format "best" Picks the best available subtitle format (e.g., .vtt or .srt).
--convert-subs vtt Converts all subtitles to .srt
--skip-download Downloads only subtitles, no video files
--sleep-interval 30 --max-sleep-interval 300 Waits 30 seconds to 5 mins, randomly between downloads, to avoid rate limiting
--retries infinite Keeps retrying failed downloads forever
--fragment-retries infinite Retries broken subtitle or video fragments
--rate-limit 0.1M Limits download rate to 0.1 MB/s for stable performance
--throttled-rate 0.05M Treats anything slower than 50 KB/s as throttled, helping yt-dlp retry correctly
--download-archive downloaded.txt Logs downloaded videos so they won’t be re-downloaded on subsequent runs
--ignore-errors Continues if a video is missing, age-restricted, or private
--user-agent "<UA"> Pretend to be a browser
-4 use IPv4 instead of IPv6
yt-dlp --cookies-from-browser firefox Assuming you just used Firefox to use YouTube with cookies, reuse those here
-o "%(id)s.%(ext)s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dTjY3uWU.jv.vtt
Ja9dTjY3uWU.ka.vtt
Ja9dTjY3uWU.kha.vtt
Ja9dTjY3uWU.kk.vtt
Ja9dTjY3uWU.kl.vtt
Ja9dTjY3uWU.km.vtt
Ja9dTjY3uWU.kn.vtt
Ja9dTjY3uWU.lg.vtt
Ja9dTjY3uWU.mfe.vtt
Ja9dTjY3uWU.my.vtt
Ja9dTjY3uWU.nl.vtt
Ja9dTjY3uWU.rw.vtt
Ja9dTjY3uWU.sq.vtt
Ja9dTjY3uWU.zh-Hans.vtt
Ja9dTjY3uWU.zh-Hant.vtt

I'm running it now without such a high throttle rate, which is getting some but many are skipped with HTTP Error 429: Too Many Requests.

I'll make a PR to remove the duplicates, add the ones I could get so far, and change the code @mikemonteith wrote to process the en-GB ones by default, and then see how to add a locale selector

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions