HOW TO extract subtitles from a YouTube video
- Open the video page in Chrome browser (or any other browser that provides HTTP debugging/Developer Tools) and pause the video
- Right click anywhere on the page, and click on Inspect Element OR hit the F12 function key.
- Click on Network tab
- Under the Network tab look for an item called timedtext.
- Right click on it and open that file in a new tab.
- An xml file containing subtitles with their timestamps(the stuff inside of <>) opens up.
- Open up Microsoft Excel
- Copy paste the subtitles inside one cell
- Press Ctrl+H
- In the replace tab type <*> in the Find What textbox and leave the Replace With textbox blank, and click Replace All. The search expression will remove all tags within the original text.
By specifying the language and VideoId in this generic URL -
For example, for a English subtitles for a video whose id is CjarTgjKcX8, try https://www.youtube.com/api/timedtext?lang=en&v=CjarTgjKcX8
The subtitles can be fetched only if captions are manually transcribed i.e. not automatically generated.
There is an open-source tool called Google2SRT that downloads all available subs from a YouTube video with one click & converts them into .srt format so that it can be used within media players like VLC Media Player.
Also see:
Low bandwidth? Try mobile version of popular websites on PC/laptop
HOW TO add subtitles to YouTube videos
Summaries of Google Webmaster Central YouTube videos
As per WebApps StackExchange forum thread there's a third way doing this, by using YT subtitles tool
ReplyDeleteThanks for the tutorial. Worked great for me.
ReplyDeleteUnfortunately, this doesn't seem to work anymore. I tried it on videoid k2JhgP6l0ss
ReplyDelete@Sepero - The subtitles can be fetched only if captions are manually transcribed i.e. not if they are automatically generated. The video you mentioned has automated captions.
ReplyDelete