Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension is added even when template does not contain formatting variable for it #26007

Open
XANi opened this issue Jul 14, 2020 · 0 comments
Open

Comments

@XANi
Copy link

@XANi XANi commented Jul 14, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.06.16.1
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

youtube-dl https://www.youtube.com/watch\?v\=0qkLFgMJJmA -o /tmp/1.file -v      
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.youtube.com/watch?v=0qkLFgMJJmA', '-o', '/tmp/1.file', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2020.06.16.1
[debug] Python version 3.8.3 (CPython) - Linux-5.6.0-2-amd64-x86_64-with-glibc2.29
[debug] exe versions: avconv 4.3-2, avprobe 4.3-2, ffmpeg 4.3-2, ffprobe 4.3-2, phantomjs ., rtmpdump 2.4
[debug] Proxy map: {}
[youtube] 0qkLFgMJJmA: Downloading webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://r4---sn-f5f7lne6.googlevideo.com/videoplayback?expire=1594771336&ei=KPMNX8yYIfGJv_IPrPar6A8&ip=85.222.111.150&id=o-AOI9vBlsJFh-y3fdkNTqAV55grpybj26EWKMjoOm7NtH&itag=248&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&source=youtube&requiressl=yes&mh=t1&mm=31%2C26&mn=sn-f5f7lne6%2Csn-4g5e6nz7&ms=au%2Conr&mv=m&mvi=4&pl=18&initcwndbps=1573750&vprv=1&mime=video%2Fwebm&gir=yes&clen=40218408&dur=209.880&lmt=1543024205244104&mt=1594749633&fvip=4&keepalive=yes&c=WEB&txp=5432432&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAIUH_7L1bgtbvDIC48mBeYsZdCGHqr0y9Eb8GorNx7qSAiB6FWnqGIVGdBS_DIVFXOMIkbL7k3GrHS4JRQb5aKQ8IA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgPGMN_aUobPhfQRr9y0TYTAenkyPevUXcBvqfRnHjGAYCIEQwysmUL73ISjBaz77gyhhfle0udEWYuueItrgNeZr3&ratebypass=yes'
[download] Destination: /tmp/1.file.f248
[download] 100% of 38.36MiB in 00:01
[debug] Invoking downloader on 'https://r4---sn-f5f7lne6.googlevideo.com/videoplayback?expire=1594771336&ei=KPMNX8yYIfGJv_IPrPar6A8&ip=85.222.111.150&id=o-AOI9vBlsJFh-y3fdkNTqAV55grpybj26EWKMjoOm7NtH&itag=251&source=youtube&requiressl=yes&mh=t1&mm=31%2C26&mn=sn-f5f7lne6%2Csn-4g5e6nz7&ms=au%2Conr&mv=m&mvi=4&pl=18&initcwndbps=1573750&vprv=1&mime=audio%2Fwebm&gir=yes&clen=2592539&dur=209.901&lmt=1543026149477938&mt=1594749633&fvip=4&keepalive=yes&c=WEB&txp=5411222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAK-u41yeUNrc5KHJhuIcqkaDCFzH6-r2x3GG6-0QZwJcAiABFXvrFackfLrD0A90Xuq2mjF5EgfdFSWwtBvF5p847g%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgPGMN_aUobPhfQRr9y0TYTAenkyPevUXcBvqfRnHjGAYCIEQwysmUL73ISjBaz77gyhhfle0udEWYuueItrgNeZr3&ratebypass=yes'
[download] Destination: /tmp/1.file.f251
[download] 100% of 2.47MiB in 00:00
[ffmpeg] Merging formats into "/tmp/1.file.webm"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i file:/tmp/1.file.f248 -i file:/tmp/1.file.f251 -c copy -map 0:v:0 -map 1:a:0 file:/tmp/1.file.temp.webm
Deleting original file /tmp/1.file.f248 (pass -k to keep)
Deleting original file /tmp/1.file.f251 (pass -k to keep)


Description

When using format string in -o that does not contain any output template variable, in this example -o /tmp/1.file, youtube-dl still adds the extension for the video if the extension does not match the downloaded format, for example if the downloaded container format is webm, the following interaction happens:

  • -o /tmp/1.file.webm => /tmp/1.file.webm
  • -o /tmp/1.file -> /tmp/file.webm
  • -o /tmp/1.file.mp4 -> "/tmp/file.mp4.webm

which is... confusing to say the least and as far as I've searched, undocumented.

In my particular case I've generated a tmpfile name and passed it to youtube-dl for output but it just appended a file extension to it for no good reason and of course script calling it couldn't predict that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.