Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Auto generated subtitles on YouTube #24257
Comments
|
I have been trying to find a work around for this for days now. Saw you posted this days ago, was hoping it would have a fix by now. The issue for me is with youtube livestream videos. ydl will not recognize the auto subs until the video is finished streaming AND once youtube has converted it to a non HLS video container, usually taking hours for longer videos on youtube's end. Have you found any useful way to grab them in the interim? |
|
I found a way to download them in XML format by using the Developer Tools in Google Chrome. Open the YouTube video in Google Chrome and pause the video and then click the CC button to enable the subtitles. Press F12 and click in the Network tab, then right click on the item that starts with "timedtext" and click Copy followed by Copy link address. Now paste the copied link to any download manager to save it. I just used "wget" and it worked, but if you're using Windows then you may have to either use a download manager or you can download the Windows version of wget. It's a command-line program, and to download the link that you copied you just open a command prompt and type: wget "the link you copied previously" Make sure you put the link in quotes because it has special characters in the link. |
|
I used this series of piped commands to convert the XML to plaintext. it works in Linux, but YMMV in Windows.
Replace subtitles.xml with the name of your subtitles file. If you want to save the plaintext version to a file you can do this:
|
Checklist
Verbose log
Provide the complete verbose output of youtube-dl that clearly demonstrates the problem.
Add the
-vflag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the WHOLE output and insert it below. It should look similar to this:[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
[debug] youtube-dl version 2020.03.06
[debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2
[debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
[debug] Proxy map: {}
-->