Downloading youtube closed captions as video subtitles #65

Closed
opened 2026-02-20 21:01:13 -05:00 by deekerman · 32 comments
Owner

Originally created by @joshtriplett on GitHub (Mar 2, 2011).

I recently discovered gcap, which can download youtube closed captions as a .srt subtitle. I'd love to see that functionality integrated into youtube-dl.

Originally created by @joshtriplett on GitHub (Mar 2, 2011). I recently discovered [gcap](http://code.google.com/p/gcap/), which can download youtube closed captions as a .srt subtitle. I'd love to see that functionality integrated into youtube-dl.
deekerman 2026-02-20 21:01:13 -05:00
  • closed this issue
  • added the
    request
    label
Author
Owner

@rifter commented on GitHub (Aug 14, 2011):

gcap seems not to work anymore, or at least it is not working for me. I think it is getting the same parsing problems some other youtube interface software had.
It would be nice if there was some way to get youtube-dl to get the captions because there are some videos I want that have captions and are kind of useless without them.

@rifter commented on GitHub (Aug 14, 2011): gcap seems not to work anymore, or at least it is not working for me. I think it is getting the same parsing problems some other youtube interface software had. It would be nice if there was some way to get youtube-dl to get the captions because there are some videos I want that have captions and are kind of useless without them.
Author
Owner

@phihag commented on GitHub (Aug 14, 2011):

youtube's subtitles format doesn't seem to complicated. Unfortunately, gcap is GPL-licensed, so we can't translate their source code from Perl to Python.

@phihag commented on GitHub (Aug 14, 2011): youtube's [subtitles format](http://code.google.com/apis/youtube/2.0/developers_guide_protocol_captions.html#Retrieve_Caption_Track) doesn't seem to complicated. Unfortunately, gcap is GPL-licensed, so we can't translate their source code from Perl to Python.
Author
Owner

@rbrito commented on GitHub (Oct 19, 2011):

I'm not really sure that the (re)implementation of what gcap does needs to be a clean-room implementation to avoid problems with license differences. Does it?

I am motivated to look at their implementation and see what we can do to support those, perhaps in an extra information extractor... I don't know what command line option to assign to it, though. :)

Regards.

@rbrito commented on GitHub (Oct 19, 2011): I'm not really sure that the (re)implementation of what gcap does needs to be a clean-room implementation to avoid problems with license differences. Does it? I am motivated to look at their implementation and see what we can do to support those, perhaps in an extra information extractor... I don't know what command line option to assign to it, though. :) Regards.
Author
Owner

@Ergzay commented on GitHub (Oct 25, 2011):

I also would love to see this feature. I often look at Japanese videos and ripping the Japanese videos without their subtitles makes the videos unable to be shown to anyone else, which I do quite often. (I can understand Japanese to some extent.)

@Ergzay commented on GitHub (Oct 25, 2011): I also would love to see this feature. I often look at Japanese videos and ripping the Japanese videos without their subtitles makes the videos unable to be shown to anyone else, which I do quite often. (I can understand Japanese to some extent.)
Author
Owner

@rbrito commented on GitHub (Oct 25, 2011):

On Oct 25 2011, Ergzay wrote:

I also would love to see this feature.

As soon as @phihag commits the fixes to get Facebook videos working again I
will try to start working on this and see what I can come up with. :)

No promises, besides the fact that I will try to get this to work (as I am
also interested in this feature).

@rbrito commented on GitHub (Oct 25, 2011): On Oct 25 2011, Ergzay wrote: > I also would love to see this feature. As soon as @phihag commits the fixes to get Facebook videos working again I will try to start working on this and see what I can come up with. :) No promises, besides the fact that I will try to get this to work (as I am also interested in this feature).
Author
Owner

@ghost commented on GitHub (Oct 27, 2011):

I needed the subtitles for some videos so I have wrotten a small python class addressing this
I you like it you are free to use it in any way desired, check it out:
https://github.com/lasupermarmota/getyoutubecc

@ghost commented on GitHub (Oct 27, 2011): I needed the subtitles for some videos so I have wrotten a small python class addressing this I you like it you are free to use it in any way desired, check it out: https://github.com/lasupermarmota/getyoutubecc
Author
Owner

@phihag commented on GitHub (Oct 27, 2011):

@lasupermarmota Just to clarify: Are you putting that project into the public domain? If so, we'd be happy to integrate the code into youtube-dl.

@phihag commented on GitHub (Oct 27, 2011): @lasupermarmota Just to clarify: Are you putting that project into the public domain? If so, we'd be happy to integrate the code into youtube-dl.
Author
Owner

@ghost commented on GitHub (Oct 27, 2011):

Yes, you are free to use it modified and do whatever you like with the code.
Anyway I don't promise anything but if you need some mod or adaption and it
doesn't take so much time, you can tell me i can try to implement

2011/10/27 Philipp Hagemeister <
reply@reply.github.com>

@lasupermarmota Just to clarify: Are you putting that project into the
public domain? If so, we'd be happy to integrate the code into youtube-dl.

Reply to this email directly or view it on GitHub:
https://github.com/rg3/youtube-dl/issues/90#issuecomment-2543039

@ghost commented on GitHub (Oct 27, 2011): Yes, you are free to use it modified and do whatever you like with the code. Anyway I don't promise anything but if you need some mod or adaption and it doesn't take so much time, you can tell me i can try to implement 2011/10/27 Philipp Hagemeister < reply@reply.github.com> > @lasupermarmota Just to clarify: Are you putting that project into the > public domain? If so, we'd be happy to integrate the code into youtube-dl. > > ## > > Reply to this email directly or view it on GitHub: > https://github.com/rg3/youtube-dl/issues/90#issuecomment-2543039
Author
Owner

@rbrito commented on GitHub (Oct 27, 2011):

@lasupermarmota: Excellent!

@rbrito commented on GitHub (Oct 27, 2011): @lasupermarmota: Excellent!
Author
Owner

@nirbheek commented on GitHub (Jan 3, 2012):

I'd really love to see this in youtube-dl, is there any progress on this? Thanks!

@nirbheek commented on GitHub (Jan 3, 2012): I'd really love to see this in youtube-dl, is there any progress on this? Thanks!
Author
Owner

@nirbheek commented on GitHub (Jan 11, 2012):

Well, I got tired of waiting, so I wrote a downloader + parser for you guys. This one converts youtube annotations to ASS format, with proper font colour, embarrassing bgcolour interpretation, and hacky text positioning.

https://github.com/nirbheek/youtube-ass

I'm a bit low on bandwidth, so I only tested it with this video: https://www.youtube.com/watch?v=4Pt0f7j2kS0

@nirbheek commented on GitHub (Jan 11, 2012): Well, I got tired of waiting, so I wrote a downloader + parser for you guys. This one converts youtube annotations to ASS format, with proper font colour, embarrassing bgcolour interpretation, and hacky text positioning. https://github.com/nirbheek/youtube-ass I'm a bit low on bandwidth, so I only tested it with this video: https://www.youtube.com/watch?v=4Pt0f7j2kS0
Author
Owner

@macedd commented on GitHub (Mar 11, 2012):

How to use it @nirbheek?
Which solutions are you guys using with youtube-dl? Wish to find out some shell stuff to get a better experience...

@macedd commented on GitHub (Mar 11, 2012): How to use it @nirbheek? Which solutions are you guys using with youtube-dl? Wish to find out some shell stuff to get a better experience...
Author
Owner

@FiloSottile commented on GitHub (Mar 12, 2012):

I'm on it. I hope to have it ready to get merged in a couple of days.
I have a question for a project manager: I already have an open pull request, what should I do? Go on on that master of my fork? Create a new branch aligned with my fork? Create a new branch aligned with your master?

@FiloSottile commented on GitHub (Mar 12, 2012): I'm on it. I hope to have it ready to get merged in a couple of days. I have a question for a project manager: I already have an open pull request, what should I do? Go on on that master of my fork? Create a new branch aligned with my fork? Create a new branch aligned with your master?
Author
Owner

@rbrito commented on GitHub (Mar 12, 2012):

Hi @thiagof, @nirbheek and others.

On Mar 11 2012, thiagof wrote:

Which solutions are you guys using with youtube-dl? Wish to find out some
shell stuff to get a better experience...

An "emergency solution" would be to use gcap while this is not yet merged.

That being said, this week (probably Wed or so) I am planning on releasing a
new version of TunesViewer (a downloader for iTunes U) and, if nobody beats
me to it, I will be working on this support of closed captions to
youtube-dl.

Regards,

Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 4096R/BCFCAAAA
http://rb.doesntexist.org/blog : Projects : https://github.com/rbrito/
DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br

@rbrito commented on GitHub (Mar 12, 2012): Hi @thiagof, @nirbheek and others. On Mar 11 2012, thiagof wrote: > Which solutions are you guys using with youtube-dl? Wish to find out some > shell stuff to get a better experience... An "emergency solution" would be to use gcap while this is not yet merged. That being said, this week (probably Wed or so) I am planning on releasing a new version of TunesViewer (a downloader for iTunes U) and, if nobody beats me to it, I will be working on this support of closed captions to youtube-dl. Regards, ## Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 4096R/BCFCAAAA http://rb.doesntexist.org/blog : Projects : https://github.com/rbrito/ DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br
Author
Owner

@phihag commented on GitHub (Mar 12, 2012):

@FiloSottile Feel free to create a new branch and ask a pull request from there.

@phihag commented on GitHub (Mar 12, 2012): @FiloSottile Feel free to create a new branch and ask a pull request from there.
Author
Owner

@phihag commented on GitHub (Mar 15, 2012):

This should work now with Filipo's excellent contribution, --write-srt.

@phihag commented on GitHub (Mar 15, 2012): This should work now with Filipo's excellent contribution, `--write-srt`.
Author
Owner

@nirbheek commented on GitHub (Mar 15, 2012):

Hmmm. Sorry, but this implementation is quite sub-optimal. I chose ASS instead of SRT specifically because SRTs cause a loss of information.

In youtube annotations, you can have multiple captions in various places on the screen (often pointing at specific things), and they have colour information, and can also move with time.

@nirbheek commented on GitHub (Mar 15, 2012): Hmmm. Sorry, but this implementation is quite sub-optimal. I chose ASS instead of SRT specifically because SRTs cause a loss of information. In youtube annotations, you can have multiple captions in various places on the screen (often pointing at specific things), and they have colour information, and can also move with time.
Author
Owner

@joshtriplett commented on GitHub (Mar 15, 2012):

@nirbheek From what I can tell, the bits that got merged cover youtube closed captions, which seems somewhat orthogonal to your work on annotations. Also, I don't think youtube closed captions support any of the features you describe, so most subtitle formats can represent them without loss of information.

I'd still love to see your annotation support merged as well, and with both present, it would make sense to download them into a single subtitle file and format to make it easy for a player to display both.

@joshtriplett commented on GitHub (Mar 15, 2012): @nirbheek From what I can tell, the bits that got merged cover youtube closed captions, which seems somewhat orthogonal to your work on annotations. Also, I don't think youtube closed captions support any of the features you describe, so most subtitle formats can represent them without loss of information. I'd still love to see your annotation support merged as well, and with both present, it would make sense to download them into a single subtitle file and format to make it easy for a player to display both.
Author
Owner

@joshtriplett commented on GitHub (Mar 15, 2012):

@nirbheek Might I suggest opening a separate pull request for your annotation support, ideally including support for downloading and converting captions, annotations, or both?

@joshtriplett commented on GitHub (Mar 15, 2012): @nirbheek Might I suggest opening a separate pull request for your annotation support, ideally including support for downloading and converting captions, annotations, or both?
Author
Owner

@nirbheek commented on GitHub (Mar 15, 2012):

@joshtriplett ah I see what you mean. Sorry about the confusion. :)

Should I open a new issue for that or is there one already open? Thanks!

@nirbheek commented on GitHub (Mar 15, 2012): @joshtriplett ah I see what you mean. Sorry about the confusion. :) Should I open a new issue for that or is there one already open? Thanks!
Author
Owner

@nirbheek commented on GitHub (Mar 15, 2012):

I haven't had the time to work on a pull request yet, I'll try to find some this week or the next.

@nirbheek commented on GitHub (Mar 15, 2012): I haven't had the time to work on a pull request yet, I'll try to find some this week or the next.
Author
Owner

@macedd commented on GitHub (Mar 15, 2012):

Awesome! great job

@macedd commented on GitHub (Mar 15, 2012): Awesome! great job
Author
Owner

@kenorb commented on GitHub (Jul 14, 2013):

WARNING: video has no closed captions.

How we can we ignore the warning? Why we need to exit the whole app in case of missing subtitles?
I've hundreds videos to download and some of has them has subtitles, some of them not.

@kenorb commented on GitHub (Jul 14, 2013): `WARNING: video has no closed captions.` How we can we ignore the warning? Why we need to exit the whole app in case of missing subtitles? I've hundreds videos to download and some of has them has subtitles, some of them not.
Author
Owner

@jaimeMF commented on GitHub (Jul 14, 2013):

@nirbheek Open a new issue for that with a link to the video/playlist that fails and with the output when running youtube-dl with the --verbose option, please.

@jaimeMF commented on GitHub (Jul 14, 2013): @nirbheek Open a new issue for that with a link to the video/playlist that fails and with the output when running youtube-dl with the `--verbose` option, please.
Author
Owner

@MaddTheSane commented on GitHub (Jul 14, 2013):

Is it possible to implement embedded closed-captions in mp4 files? Another thing: should the annotations and closed captions/subtitles be handled differently?

@MaddTheSane commented on GitHub (Jul 14, 2013): Is it possible to implement embedded closed-captions in mp4 files? Another thing: should the annotations and closed captions/subtitles be handled differently?
Author
Owner

@jaimeMF commented on GitHub (Jul 15, 2013):

@MaddTheSane open new issues for the requests

@jaimeMF commented on GitHub (Jul 15, 2013): @MaddTheSane open new issues for the requests
Author
Owner

@kakila commented on GitHub (Aug 10, 2013):

This line

youtube-dl --write-srt --srt-lang es http://www.youtube.com/watch?v=X6p5AZp7r_Q

doesn't download the spanish subtitles though the video has them. Any ideas why?

@kakila commented on GitHub (Aug 10, 2013): This line ``` youtube-dl --write-srt --srt-lang es http://www.youtube.com/watch?v=X6p5AZp7r_Q ``` doesn't download the spanish subtitles though the video has them. Any ideas why?
Author
Owner

@ghost commented on GitHub (Aug 10, 2013):

Try to download es-ES

pulpe@tardis:~$ youtube-dl --list-subs http://www.youtube.com/watch?v=X6p5AZp7r_Q
[youtube] Setting language
[youtube] X6p5AZp7r_Q: Downloading video webpage
[youtube] X6p5AZp7r_Q: Downloading video info webpage
[youtube] X6p5AZp7r_Q: Extracting video information
[youtube] X6p5AZp7r_Q: Checking available subtitles
[youtube] X6p5AZp7r_Q: Available subtitles for video: fr,en,tr,de,ko,da,pt-BR,es-ES
@ghost commented on GitHub (Aug 10, 2013): Try to download es-ES ``` pulpe@tardis:~$ youtube-dl --list-subs http://www.youtube.com/watch?v=X6p5AZp7r_Q [youtube] Setting language [youtube] X6p5AZp7r_Q: Downloading video webpage [youtube] X6p5AZp7r_Q: Downloading video info webpage [youtube] X6p5AZp7r_Q: Extracting video information [youtube] X6p5AZp7r_Q: Checking available subtitles [youtube] X6p5AZp7r_Q: Available subtitles for video: fr,en,tr,de,ko,da,pt-BR,es-ES ```
Author
Owner

@kakila commented on GitHub (Aug 10, 2013):

Thank you very much! that was really useful. Sorry for n00b.

@kakila commented on GitHub (Aug 10, 2013): Thank you very much! that was really useful. Sorry for n00b.
Author
Owner

@coolpra commented on GitHub (Dec 12, 2013):

I was also searching this and I found a great solution....you can download the video + subtitle language you want as well...

check the following link.... **[Edit by @phihag: Removed link to closed-source software]

@coolpra commented on GitHub (Dec 12, 2013): I was also searching this and I found a great solution....you can download the video + subtitle language you want as well... check the following link.... **[Edit by @phihag: Removed link to closed-source software]
Author
Owner

@phihag commented on GitHub (Dec 12, 2013):

@coolpra This is an issue tracker for youtube-dl, a software which does allow you to download subtitles. Please refrain from linking to irrelevant software and discussing non-youtube-dl related topics here.

@phihag commented on GitHub (Dec 12, 2013): @coolpra This is an issue tracker for youtube-dl, a software which does allow you to download subtitles. Please refrain from linking to irrelevant software and discussing non-youtube-dl related topics here.
Author
Owner

@95mobi commented on GitHub (Sep 8, 2014):

Edited by @phihag: Snip spam.

@95mobi commented on GitHub (Sep 8, 2014): Edited by @phihag: Snip spam.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#65
No description provided.