Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Output info_dict reports incorrect extension when formats are merged into a mkv video #8349
Comments
|
If there's no easy way to fix this, are there some possible temporary workarounds instead of a "for file in os.listdir"? |
|
Thanks for the detailed report. This problem shares the same cause with #5710. There are some discussions. |
I am developing a tool called video2commons and in its backend it has to programmatically download the video and determine the filename downloaded. However, for mkv videos there's nowhere in the output dict that mentions mkv at all:
The mentioned extension seems to be webm: "u'ext': u'webm'", and trying to determine the filename with
self.outtmpl % {'ext':self.info['ext']}gives/srv/v2coutput/7c47160c0da8e30c/dl.webminstead of the expected/srv/v2coutput/7c47160c0da8e30c/dl.mkvLooking into the source, there is, in fact, an attempt to set the extension in info_dict to "mkv": (YoutubeDL.py#L1601):
info_dict['ext'] = 'mkv'However, this info_dict it working on a copy of the original info_dict that is returned: (YoutubeDL.py#L1361):
And the attempted change in the dict creates no effect at all to the returned dict; thus, the correct extension is unable to determined programmatically.