Created
March 10, 2019 00:59
-
-
Save luismond/45322fe68fe94c2cb77712a57ed14ff7 to your computer and use it in GitHub Desktop.
Downloads .vtt subtitle file from youtube video
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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