How to download only subtitles of videos using youtube-dl

96

39

How can I download subtitles of a list of videos using youtube-dl? I need an option for this. However I could not find an option to download only subtitles

fivetech

Posted 2015-06-13T17:22:46.100

Reputation: 1 103

7the option is --skip-download – 尤川豪 – 2015-10-01T08:57:45.630

2I'm confused as to why this question is so popular. What's the use case for downloading subtitles from a YouTube video that all these people have in mind? Why would YouTube subtitles - which in many cases are non-existent or automatically generated - be any more useful than a proper subtitle file? – Hashim – 2018-11-12T02:49:27.787

Answers

138

There is an option, clearly mentioned in the documention:

Subtitle Options:

--write-sub                      Write subtitle file
--write-auto-sub                 Write automatic subtitle file (YouTube only)
--all-subs                       Download all the available subtitles of the video
--list-subs                      List all available subtitles for the video
--sub-format FORMAT              Subtitle format, accepts formats preference, for example: "srt" or "ass/srt/best"
--sub-lang LANGS                 Languages of the subtitles to download (optional) separated by commas, use IETF language tags like 'en,pt'

So for example, to list all subs for a video:

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

To download all subs, but not the video:

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

l'L'l

Posted 2015-06-13T17:22:46.100

Reputation: 1 840

31I gave the docs a fair look and didn't find the --skip-download option which is hidden under *Verbosity / Simulation Options*. Glad @fivetech asked this question, or I may still be stuck. – Zaz – 2016-08-07T19:04:11.700

6how to download autogenerated subtitles? – brauliobo – 2017-09-07T17:39:27.677

2It's clearly "mentioned in documentation" and "clearly mentioned in this answer": "--write-auto-sub Write automatic subtitle file (YouTube only)" – radekg – 2017-09-16T07:41:53.653

1It's not that "clearly mentioned in documentation". What is the difference between write-sub, write-auto-sub vs all-subs? – Mugen – 2017-10-27T05:21:21.933

5

@brauliobo --write-auto-sub from documentation, youtube-dl --sub-lang LANG --write-auto-sub --skip-download URI.

– Pablo A – 2018-01-13T18:35:09.497

Trying to download subtitles at the moment gives ERROR: '—list-subs' is not a valid URL. Set —default-search "ytsearch" (or run youtube-dl "ytsearch:—list-subs" ) to search YouTube message. I'm running youtube-dl v2019.02.08. – user598527 – 2019-02-12T21:14:38.403

1@user598527: There should be two dashes preceding the option, not one (--list-subs). – l'L'l – 2019-02-13T05:52:45.817

1

@l'L'l: Thank you, I've been using an addon to convert -- to for some days, didn't cross my mind how it can affect code and commands. Thankfully I didn't create a bug report!

– user598527 – 2019-02-13T08:54:25.130

2youtube-dl --sub-lang en --write-auto-sub --sub-format srt --skip-download v0uYZ4rTOrk 1. get ENG subtitles 2. get auto-generated subtitles 3. get subtitles in srt format 4. do not download the movie – deadfish – 2019-03-21T16:14:58.097

13

Or you can only download one subtitle

youtube-dl --write-sub --sub-lang en --skip-download URL 

m3asmi

Posted 2015-06-13T17:22:46.100

Reputation: 231

2Or --write-auto-sub for downloading the automatically generated subtitles! – Lenar Hoyt – 2019-11-22T16:19:15.500

5

Another simple way to download subtitles from YouTube is to download Google2SRT. Google2SRT is a free, open source program for Windows, Mac and Linux that is able to download, save and convert multiple subtitles from YouTube videos.

Usage

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

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

  2. Choose the language by selecting the appropriate check box provided and press Go.

  3. View the destination folder that was input in the SRT subtitles textbox to locate the SRT files.

jegadesh

Posted 2015-06-13T17:22:46.100

Reputation: 83

8The issue with this is that it only works with YouTube; youtube-dl supports hundreds of other sites. – Hayden Schiff – 2016-11-14T02:48:39.290

7The question is about youtube-dl. – user598527 – 2017-04-18T20:53:19.850

1Thanks so much, jegadesh! Google2SRT is just what I needed to download auto-generated closed captions/subtitles from YouTube, since youtube-dl does not handle them properly (instead returning foo has no subtitles). – Miles Wolbe – 2018-02-04T06:31:22.773

2@miles-wolbe I'd appreciate it if you could mention a YouTube video where youtube-dl failed. – naki – 2019-03-19T07:37:27.620