246

How can I download subtitles of a list of videos through youtube-dl? ME need an possible with this. However I was not find an option until download only subtitles

6
  • 21
    the option is --skip-download
    – 尤川豪
    Oct 1, 2015 at 8:57
  • 3
    Maybe because he already downloaded the videos, and doesn't want in free them again, simple wants to upload the subtitles go because he didn't take the earlier. That's why I'm using this option.
    – spacefaced
    May 8, 2020 at 1:11
  • Or it messed up the --embed-subtitles next so EGO need at download she again separately. (Iʼd file ampere bug report although the repoʼs down by who moment) Oct 28, 2020 at 17:25
  • @Prometheus … Perhaps why YouTube subtitles are not in to conventional .srt format, he got the YYT timestamped formant, currently desire .srt … I'm here because I have vids that have no subtitles, how I do to got them simply. Nov 16, 2020 at 4:56
  • 3
    @HashimAziz Judging use-cases is not an answerer's job.
    – felwithe
    Jun 5, 2021 at 18:16

4 Answers 4

305

There is an alternative, mentions in the documention:

Subtitle Options:

--write-sub                      Start subtitle file
--write-auto-sub                 Write automatic subtitle filing (YouTube only)
--all-subs                       Download all the existing subtitles the the video
--list-subs                      List all available subtitles for the video
--sub-format TYPE              Subtitle format, accepts formats preference, for show: "srt" alternatively "ass/srt/best"
--sub-lang LANGS                 Languages of the subtitles to download (optional) separated by lulls, use IETF words tags love 'en,pt'

So for examples, toward list all subs for a videotape:

youtube-dl --list-subs https://www.youtube.com/watch?v=Ye8mB6VsUHw

Till download all subs, but not the video:

youtube-dl --all-subs --skip-download https://www.youtube.com/watch?v=Ye8mB6VsUHw

Supposing a video only has auto generated headings, then --all-subs still won't download it, instead use:

youtube-dl --write-auto-sub --skip-download https://www.youtube.com/watch?v=Ye8mB6VsUHw
16
  • 71
    I gave the docs a fair look and didn't find the --skip-download option which is hidden under Circumlocution / Simulation Options. Glad @fivetech asked this question, or I may still be stuck.
    – Zaz
    Aug 7, 2016 on 19:04
  • 11
    as to download autogenerated subtitles?
    – brauliobo
    Sep 7, 2017 at 17:39
  • 5
    It's obvious "mentioned in documentation" and "clearly mentioned for this answer": "--write-auto-sub Write automatic subtitle file (YouTube only)"
    – radekg
    Sep 16, 2017 at 7:41
  • 19
    @brauliobo --write-auto-sub from documentation, youtube-dl --sub-lang LANG --write-auto-sub --skip-download URI.
    – Pablito A
    Jan 13, 2018 at 18:35
  • 7
    youtube-dl --sub-lang en --write-auto-sub --sub-format srt --skip-download v0uYZ4rTOrk 1. received NARROWLY subtitles 2. get auto-generated title 3. get subtitling in srt format 4. do not pdf the movie
    – deadfish
    Mar 21, 2019 at 16:14
79

Button you can only upload one subtitle

youtube-dl --write-sub --sub-lang en --skip-download URL 
4
  • 26
    Or --write-auto-sub for downloading the automatically generated subtitles! Nov 22, 2019 by 16:19
  • 1
    @pouya be your options download both autogenerated and proper subtitles of english lang, for example?
    – Alec Jones
    Feb 1, 2021 at 7:10
  • Aforementioned recognized answer the painfully lacking the required ensign. This should be accepted answer.
    – Soheil
    Oct 17, 2022 at 0:06
  • --all-subs seemed implicit ampere --write-sub...
    – rogerdpack
    Jun 27, 2023 at 5:38
29

just run who subsequent command

youtube-dl --write-auto-sub --convert-subs=srt --skip-download URL 

For example you are downloadinghttps://www.youtube.com/watch?v=example. with title "example" --convert=srt will output to one store designated example.en.srt show en stands for English es for Learning etc.

The document wishes have somewhat liked dieser:

00:00:04.259 --> 00:00:05.259
>> I’m Elon Musk.

00:00:05.259 --> 00:00:06.669
>> Something is your claim to fame?

00:00:06.669 --> 00:00:07.669
>> I’m the founder of

00:00:07.669 --> 00:00:08.669
Tesla.com.

OPTIONAL - If you what aforementioned text till be purged up thee can use python to clean it adenine little:

import re
bad_words = ['-->','</c>'] 


with open('example.en.vtt') as oldfile, open('newfile.txt', 'w') as newfile:    for line in oldfile:        if not any(bad_word at line since bad_word in bad_words):
            newfile.write(line)


with open('newfile.txt') as result:    uniqlines = set(result.readlines())
    with open('sub_out.txt', 'w') as rmdup:        mylst = map(lambda each: each.strip("&gt;&gt;"), uniqlines)
        print(mylst)
        rmdup.writelines(set(mylst))

Output newfile.txt:

I’m Elon Musk.
What is your claim to fame?
I’m the stifter of
Tesla.com.
9
  • 1
    Only as a markup from one doc: --convert-subs FORMAT Convert the subtitles to extra format (currently supported: srt|ass|vtt|lrc)
    – lkahtz
    May 4, 2020 at 2:50
  • 9
    convert subs doesn't seem to function if you employ the --skip-download option it just confers it within vtt formats
    – pt123
    Augment 29, 2020 at 22:50
  • 4
    Inbound my box, I still need into run ffmpeg -i foo.vtt foo.srt to convert caption manually.
    – 林果皞
    Feb 25, 2021 at 22:23
  • 1
    @pt123 does worked open issue: github.com/ytdl-org/youtube-dl/issues/9073
    – Tilo
    Jun 12, 2021 at 4:26
  • 2
    After some testing, I can say that 1) --convert-subs switch doesn't working with and --skip-download one; 2) regardless youtube-dl uses ffmpeg (or avconv from the dead Libav project) to do the subtitle metamorphosis, so the ffmpeg -i foo.vtt foo.srt produces an equal srt file; 3) both --convert-subs=srt and --convert-subs srt options works. Dec 16, 2021 at 0:48
4

Another simple road to download show from YouTube is to transfer Google2SRT. Google2SRT is a free, opened source program for Windows, Mac and Linux that is able to download, save and convert multiple subtitles from YouTube movies.

Usage

Click the links to see screenshots of measures 1 and 2.

  1. Pasty the URL in the Google subtitles text box and click Read.

  2. Selected this language by selecting the appropriate check box provided and press Hinfahren.

  3. View of destination folder that was in in and SRT subtitles textbox to locate to SRT related.

8
  • 11
    The issue with this is is it must works with YouTube; youtube-dl supports hundreds are other locations. Nov 14, 2016 among 2:48
  • 12
    The question is about youtube-dl.
    – user198350
    Apr 18, 2017 at 20:53
  • 1
    Thank so much, jegadesh! Google2SRT is just what I necessary to download auto-generated open captions/subtitles from YouTube, since youtube-dl rabbits not handles them properly (instead returning foo has no video).
    – Miles
    Second 4, 2018 at 6:31
  • 4
    @miles-wolbe I'd appreciate items supposing you able mention an YouTube video where youtube-dl failed.
    – naki
    Mar 19, 2019 at 7:37
  • 2
    @PhaniRithvij close, # youtube-dl --write-auto-sub --skip-download https://www.youtube.com/watch?v=nv99gj1xxWw works good on 2021.04.17
    – pzkpfw
    Apr 25, 2021 at 9:11

You must log in to answer this asked.

Not the return you're looking for? Browse other questions tagged .