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

Double underscores in the value of %(uploader_id)s are truncated #12317

Closed
Ectomind1990 opened this issue Mar 1, 2017 · 1 comment
Closed

Double underscores in the value of %(uploader_id)s are truncated #12317

Ectomind1990 opened this issue Mar 1, 2017 · 1 comment

Comments

@Ectomind1990
Copy link

@Ectomind1990 Ectomind1990 commented Mar 1, 2017

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.02.28. 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 2017.02.28

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

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

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

$ youtube-dl -v --skip-download -o '%(uploader_id)s/%(id)s.%(ext)s' https://youtu.be/nmeZVeXo7O4
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--skip-download', u'-o', u'%(uploader_id)s/%(id)s.%(ext)s', u'https://youtu.be/nmeZVeXo7O4']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.02.28
[debug] Python version 2.7.12 - Linux-4.4.0-64-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: ffmpeg 2.8.11-0ubuntu0.16.04.1, ffprobe 2.8.11-0ubuntu0.16.04.1
[debug] Proxy map: {}
[youtube] nmeZVeXo7O4: Downloading webpage
[youtube] nmeZVeXo7O4: Downloading video info webpage
[youtube] nmeZVeXo7O4: Extracting video information
[youtube] {22} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {43} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {18} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {36} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {17} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {137} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {248} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {136} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {247} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {135} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {244} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {134} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {243} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {133} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {242} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {160} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {278} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {140} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {171} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {249} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {250} signature length 40.44, html5 player en_US-vflVlxFvV
[youtube] {251} signature length 40.44, html5 player en_US-vflVlxFvV
...
<end of log>

Description of your issue, suggested solution and other information

When using Output Templates, if the value of %(uploader_id)s should contain a double underscore, the actual behaviour is as if there is only a single underscore at that position.

This can be seen in the command I gave above. It creates a directory named...
UC_Bdma6rGmzx9EBtSCQNpQ but it should be named...
UC__Bdma6rGmzx9EBtSCQNpQ

YouTube's Channel IDs are always 24 characters long, so clearly the single underscore version is wrong. You can also demonstrate that it is wrong by trying these two URLs:
https://www.youtube.com/channel/UC_Bdma6rGmzx9EBtSCQNpQ
https://www.youtube.com/channel/UC__Bdma6rGmzx9EBtSCQNpQ
The single underscore URL gives the following error: "This channel does not exist."

Additional Info

If you use --write-info-json, the values of the uploader_id and uploader_url fields in the JSON file are not affected by the bug. The value of the _filename field is affected.

It is not just directory creation that is affected by this bug. If you use a different Output Template so that the value of %(uploader_id)s gets included in the filename, you still see the bug.

YouTube's Channel IDs always start with "UC". The channel I've given as an example is UC__Bdma6rGmzx9EBtSCQNpQ - in which the double underscore comes immediately after the "UC". But the bug still happens when the double underscore is found at other positions. E.g. channel UCtk1Yv__Jcsw2NWbmZcCqsA

@dstftw dstftw closed this in 40df485 Mar 1, 2017
@Ectomind1990 Ectomind1990 mentioned this issue Mar 1, 2017
4 of 8 tasks complete
@glenn-slayden
Copy link
Contributor

@glenn-slayden glenn-slayden commented Mar 2, 2017

I can confirm that this bug also affected the %(channel_id)s feature (see #9676)), and that, if you are using the patch that I posted in the comments section of #9676, then commit 40df485 fixes the double-underscore problem for that case as well.

I guess If I get a chance I should figure out how to do a pull request to properly submit my fix for #9676...

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