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

--get-filename and JSON's _filename inaccurate #16369

Closed
legraphista opened this issue May 3, 2018 · 4 comments
Closed

--get-filename and JSON's _filename inaccurate #16369

legraphista opened this issue May 3, 2018 · 4 comments
Labels

Comments

@legraphista
Copy link

@legraphista legraphista commented May 3, 2018

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.05.01. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2018.05.01

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
[debug] youtube-dl version 2018.05.01
[debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2
[debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
[debug] Proxy map: {}
...
<end of log>

Description of your issue, suggested solution and other information

Explanation of your issue in arbitrary form goes here. Please make sure the description is worded well enough to be understood. Provide as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.

Inaccurate filename output:

# youtube-dl https://www.youtube.com/watch?v=vDIqXSrZ_50 -o "test.%(ext)s" --get-filename -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'https://www.youtube.com/watch?v=vDIqXSrZ_50', u'-o', u'test.%(ext)s', u'--get-filename', u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.05.01
[debug] Python version 2.7.14 (CPython) - Linux-4.13.0-39-generic-x86_64-with-Ubuntu-17.10-artful
[debug] exe versions: ffmpeg N-90893-gcae6f806a6, ffprobe N-90893-gcae6f806a6
[debug] Proxy map: {}
[debug] Default format spec: bestvideo+bestaudio/best
test.mp4

According to the following output, the file name should be test.mp4
But after actually downloading the file:

# youtube-dl https://www.youtube.com/watch?v=vDIqXSrZ_50 -o "test.%(ext)s" -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'https://www.youtube.com/watch?v=vDIqXSrZ_50', u'-o', u'test.%(ext)s', u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.05.01
[debug] Python version 2.7.14 (CPython) - Linux-4.13.0-39-generic-x86_64-with-Ubuntu-17.10-artful
[debug] exe versions: ffmpeg N-90893-gcae6f806a6, ffprobe N-90893-gcae6f806a6
[debug] Proxy map: {}
[youtube] vDIqXSrZ_50: Downloading webpage
[youtube] vDIqXSrZ_50: Downloading video info webpage
[youtube] vDIqXSrZ_50: Extracting video information
[debug] Default format spec: bestvideo+bestaudio/best
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[debug] Invoking downloader on u'https://r1---sn-4g5ednsz.googlevideo.com/videoplayback?ipbits=0&fvip=1&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&mime=video%2Fmp4&clen=61838118&requiressl=yes&expire=1525391983&fexp=23724337&gir=yes&ms=au%2Conr&signature=8A66B07ADE7162200C1277D72F228D96990DD4A4.C0B8BF3B634471278DA9D5292BCFF64D193BE42E&mm=31%2C26&mn=sn-4g5ednsz%2Csn-5hnedn7l&ip=2a01%3A4f8%3A13b%3A1158%3A%3A2&key=yt6&source=youtube&lmt=1516257751181769&keepalive=yes&dur=193.680&mt=1525370266&mv=m&id=o-AOb04IA3R2TNAgVG7NgBJ-QCvI4xICpA9JECM9lB_mMh&ei=D07rWuTPMsjD1gLy45TQAw&itag=137&c=WEB&pl=53&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&initcwndbps=1877500&ratebypass=yes'
[download] Destination: test.f137.mp4
[download] 100% of 58.97MiB in 00:01
[debug] Invoking downloader on u'https://r1---sn-4g5ednsz.googlevideo.com/videoplayback?ipbits=0&fvip=1&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&mime=audio%2Fwebm&clen=3023455&requiressl=yes&expire=1525391983&fexp=23724337&gir=yes&ms=au%2Conr&signature=8E3A82442D4F345CCFDF4D9E883EAAE3C8C42BE8.060A713609AE5516CA15DEF669E1EBFF471AC3B8&mm=31%2C26&mn=sn-4g5ednsz%2Csn-5hnedn7l&ip=2a01%3A4f8%3A13b%3A1158%3A%3A2&key=yt6&source=youtube&lmt=1516258459881751&keepalive=yes&dur=193.701&mt=1525370266&mv=m&id=o-AOb04IA3R2TNAgVG7NgBJ-QCvI4xICpA9JECM9lB_mMh&ei=D07rWuTPMsjD1gLy45TQAw&itag=251&c=WEB&pl=53&initcwndbps=1877500&ratebypass=yes'
[download] Destination: test.f251.webm
[download] 100% of 2.88MiB in 00:00
[ffmpeg] Merging formats into "test.mkv"
[debug] ffmpeg command line: ffmpeg -y -i 'file:test.f137.mp4' -i 'file:test.f251.webm' -c copy -map '0:v:0' -map '1:a:0' 'file:test.temp.mkv'
Deleting original file test.f137.mp4 (pass -k to keep)
Deleting original file test.f251.webm (pass -k to keep)

The output file is actually an MKV

# ll
total 63372
drwxr-xr-x  2 root root     4096 May  3 19:59 ./
drwxrwxrwt 15 root root    45056 May  3 19:58 ../
-rw-r--r--  1 root root 64838367 Jan 18 07:42 test.mkv

And printing the JSON + downloading the file, it has the same issue in the _filename key

@mrfade
Copy link
Contributor

@mrfade mrfade commented May 3, 2018

@dstftw dstftw closed this May 4, 2018
@dstftw dstftw added the duplicate label May 4, 2018
@legraphista
Copy link
Author

@legraphista legraphista commented May 4, 2018

Re-encoding loses time and quality.
Re-muxing is out of the question because opus is not officially supported in the MP4 container.
None of those are fixes or even related to the presented issue.
Since there is a warning thrown by youtube-dl, and the ext is mutated in the info_dict, the filename should be adjusted too:
https://github.com/rg3/youtube-dl/blob/ea1f5e5dbd6c58d4f0872a65b97611732f4b29bd/youtube_dl/YoutubeDL.py#L1877-L1880
@mrfade @dstftw

@forresthopkinsa
Copy link

@forresthopkinsa forresthopkinsa commented Mar 2, 2019

For anyone searching: this is a duplicate of #5710

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
4 participants
You can’t perform that action at this time.