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

--write-thumbnail truncates filename with certain output template #11506

Closed
Gorrrg opened this issue Dec 22, 2016 · 1 comment
Closed

--write-thumbnail truncates filename with certain output template #11506

Gorrrg opened this issue Dec 22, 2016 · 1 comment

Comments

@Gorrrg
Copy link

@Gorrrg Gorrrg commented Dec 22, 2016

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

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)

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:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', '--skip-download', '--output', '%(uploader)s - %(upload_date)s - %(title)s (%(id)s)', '--write-description', '--write-thumbnail', 'http://www.youtube.com/watch?v=ntU6j-et1io']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2016.12.20
[debug] Python version 3.4.4 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg 3.2, ffprobe 3.2
[debug] Proxy map: {}
[youtube] ntU6j-et1io: Downloading webpage
[youtube] ntU6j-et1io: Downloading video info webpage
[youtube] ntU6j-et1io: Extracting video information
[youtube] ntU6j-et1io: Downloading MPD manifest
[info] Writing video description to: EthosLab - 20110224 - Let's Play Minecraft - Episode 33 - Beta 1.3 (ntU6j-et1io).description
[youtube] ntU6j-et1io: Downloading thumbnail ...
[youtube] ntU6j-et1io: Writing thumbnail to: EthosLab - 20110224 - Let's Play Minecraft - Episode 33 - Beta 1.jpg

Description of your issue, suggested solution and other information

Notice the filename of the thumbnail.

The issue is that when a YouTube title string contains any periods (46th of the ASCII character set), for example version numbers or an ellipsis, the thumbnail download routine fails to write the full file name correctly with that output template I'm using. It works fine with the default output template.

It truncates after the last period of the title string. So for example if the uploader had used a title like "My new machine 2.0.1" that would end in "My new machine 2.0.jpg" instead of "My new machine 2.0.1 (xxxxxxxxxxx).jpg" and "Oh my... oh my... oh dear" would end in "Oh my... oh my...jpg" instead of "Oh my... oh my... oh dear (xxxxxxxxxxy).jpg".

Note that I omitted downloading the video file because it was unnecessary. The video file name is ok. As far as I have noticed the truncation only happens with the thumbnail file, but it may also happen with other files youtube-dl saves.

@yan12125 yan12125 added the bug label Dec 22, 2016
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 22, 2016

Well it's not a bug. You shouldn't omit %(ext)s in output templates.

$ youtube-dl --verbose --skip-download --output '%(uploader)s - %(upload_date)s - %(title)s (%(id)s).%(ext)s' --write-thumbnail 'http://www.youtube.com/watch?v=ntU6j-et1io'
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', '--skip-download', '--output', '%(uploader)s - %(upload_date)s - %(title)s (%(id)s).%(ext)s', '--write-thumbnail', 'http://www.youtube.com/watch?v=ntU6j-et1io']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.12.20
[debug] Git HEAD: bfa1073e1
[debug] Python version 3.5.2 - Linux-4.8.13-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 3.2.2, ffprobe 3.2.2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] ntU6j-et1io: Downloading webpage
[youtube] ntU6j-et1io: Downloading video info webpage
[youtube] ntU6j-et1io: Extracting video information
[youtube] ntU6j-et1io: Downloading MPD manifest
[youtube] ntU6j-et1io: Downloading thumbnail ...
[youtube] ntU6j-et1io: Writing thumbnail to: EthosLab - 20110224 - Let's Play Minecraft - Episode 33 - Beta 1.3 (ntU6j-et1io).jpg
@yan12125 yan12125 closed this Dec 22, 2016
@yan12125 yan12125 removed the bug label Dec 22, 2016
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.