I have tried to download subtitles along with the video using the following Python 3.x code. It's just not working.
Here's my code:
from __future__ import unicode_literals
import youtube_dl
ydl_opts = {
'outtmpl': '/PATH/%(title)s'+'.mp4',
'format':' (bestvideo[width>=?1080]/bestvideo)+bestaudio/best',
'subtitle': '--write-srt --sub-lang en',
}
url = input("Enter your URL: ")
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([url])
print("Downloaded!")