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.
outputformat string is not respected properly when the final file required merging #26654
Comments
|
This is expected behavior. Extension should not be hardcoded in output template. |
|
@dstftw is it then expected behaviour too that the filename outputted with the flag |
Verbose log
Description
When I download above Video, after merging I get a file named
....tmp.mkvdespite the fact that I've used the output-formatstring'%(uploader)s-_-%(title)s.tmp'.I'd expect that the final outputfile would be named in that specific case
"M4-_-M4_-_Not_Good_Enough_Official_Video.tmp".I consider this a bug, but maybe this behaviour is known and even wanted. In that case I want to mention that this makes scripting around with
youtube-dlreally hard, since one cannot get the final filenames of the files produced byyoutube-dlIn my scripting case it would be enough to have the precise final filename to work with the output file, but when using
--get-filenamethe filename that is outputted, is not the right one under every circumstances. When using something like-f bestvideo+bestaudio, the extension might change due to merging.In my specific case I'd get
M4-_-M4_-_Not_Good_Enough_Official_Video.mp4as output ofyoutube-dl -i -f bestvideo+bestaudio --restrict-filenames -o '%(uploader)s-_-%(title)s.%(ext)s' --get-filename "https://www.youtube.com/watch?v=Zn4oSL0_8ho"which is not right, since when downloading the resulting file (with
youtube-dl -i -f bestvideo+bestaudio --restrict-filenames -o '%(uploader)s-_-%(title)s.%(ext)s' "https://www.youtube.com/watch?v=Zn4oSL0_8ho") will be named"M4-_-M4_-_Not_Good_Enough_Official_Video.mkv")