Skip to content

Instantly share code, notes, and snippets.

@luismond
Created March 10, 2019 00:59
Show Gist options
  • Select an option

  • Save luismond/45322fe68fe94c2cb77712a57ed14ff7 to your computer and use it in GitHub Desktop.

Select an option

Save luismond/45322fe68fe94c2cb77712a57ed14ff7 to your computer and use it in GitHub Desktop.
Downloads .vtt subtitle file from youtube video
import youtube_dl
def download_vtt(url,lang):
ydl_opts = {
'quiet': True,
'subtitleslangs': [lang],
'writeautomaticsub': 'yes',
'skip_download': 'yes'
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([url])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment