Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading youtube closed captions as video subtitles #90

Closed
joshtriplett opened this issue Mar 2, 2011 · 32 comments
Closed

Downloading youtube closed captions as video subtitles #90

joshtriplett opened this issue Mar 2, 2011 · 32 comments
Labels

Comments

@joshtriplett
Copy link

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.

@rifter
Copy link

rifter commented 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.

@phihag
Copy link
Contributor

phihag commented 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.

@rbrito
Copy link
Contributor

rbrito commented Oct 20, 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.

@Ergzay
Copy link

Ergzay commented 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.)

@rbrito
Copy link
Contributor

rbrito commented Oct 26, 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).

@ghost
Copy link

ghost commented 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

@phihag
Copy link
Contributor

phihag commented 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.

@ghost
Copy link

ghost commented 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 <
[email protected]>

@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:
#90 (comment)

@rbrito
Copy link
Contributor

rbrito commented Oct 27, 2011

@lasupermarmota: Excellent!

@nirbheek
Copy link

nirbheek commented Jan 3, 2012

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

@nirbheek
Copy link

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

@macedd
Copy link

macedd commented 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...

@FiloSottile
Copy link
Collaborator

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?

@rbrito
Copy link
Contributor

rbrito commented 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

@phihag
Copy link
Contributor

phihag commented Mar 12, 2012

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

@phihag
Copy link
Contributor

phihag commented Mar 15, 2012

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

@phihag phihag closed this as completed Mar 15, 2012
@nirbheek
Copy link

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.

@joshtriplett
Copy link
Author

@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
Copy link
Author

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

@nirbheek
Copy link

@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
Copy link

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

@macedd
Copy link

macedd commented Mar 15, 2012

Awesome! great job

@kenorb
Copy link

kenorb commented 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.

@jaimeMF
Copy link
Collaborator

jaimeMF commented 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.

@MaddTheSane
Copy link

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

@jaimeMF
Copy link
Collaborator

jaimeMF commented Jul 15, 2013

@MaddTheSane open new issues for the requests

@kakila
Copy link

kakila commented 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?

@ghost
Copy link

ghost commented 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

@kakila
Copy link

kakila commented Aug 10, 2013

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

@coolpra
Copy link

coolpra commented 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]

@phihag
Copy link
Contributor

phihag commented 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.

@95mobi
Copy link

95mobi commented Sep 8, 2014

Edited by @phihag: Snip spam.

joedborg referenced this issue in joedborg/youtube-dl Nov 17, 2020
[pull] master from rg3:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

15 participants