Closed NightMachinery closed 6 years ago
I tried this as well:
file_name = 'dls/' + str(uuid.uuid4())
ydl_opts = {
'outtmpl': file_name
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
d2 = ydl.extract_info(url)
file_name_with_ext = file_name + "." + d2['ext']
...
It works sometimes, but when the file is merged into an mkv, d2['ext']
wrongly returns 'mp4'.
I am using this currently:
But
d2
doesn't have any filename attributes and my_hook is called two times when audio and video files are downloaded separately and then merged, and it is actually not called for the final, merged file.