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

Youtube video filename is incorrect when its title contains certain characters #22731

Closed
forever8938 opened this issue Oct 16, 2019 · 3 comments
Closed

Comments

@forever8938
Copy link

@forever8938 forever8938 commented Oct 16, 2019

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2019.10.16
  • 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

root@localhost:~# youtube-dl -j --flat-playlist GbO82vfU4R4  | jq -r '.title'
BEST KOREAN BBQ & Ox Bone Soup in Los Angeles | Japanese CLOUD Pancakes
root@localhost:~# 
root@localhost:~# youtube-dl -i -o '%(title)s' GbO82vfU4R4 --get-filename -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-i', u'-o', u'%(title)s', u'GbO82vfU4R4', u'--get-filename', u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2019.10.16
[debug] Python version 2.7.15+ (CPython) - Linux-4.15.0-55-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6, phantomjs ., rtmpdump 2.4
[debug] Proxy map: {}
[debug] Default format spec: bestvideo+bestaudio/best
BEST KOREAN BBQ & Ox Bone Soup in Los Angeles _ Japanese CLOUD Pancakes
root@localhost:~#

Description

Youtube video filename is incorrect when its title contains certain characters, such as '|'.
As you can see in the log above, the video title is clearly "BEST KOREAN BBQ & Ox Bone Soup in Los Angeles | Japanese CLOUD Pancakes", which contains a '|'.
But when I specified the output template as '%(title)s' and supposed it to be the same as the title, I got "BEST KOREAN BBQ & Ox Bone Soup in Los Angeles _ Japanese CLOUD Pancakes", where '|' becomes '_'.

I have checked that there is a field in the json called "_filename" that is exactly "BEST KOREAN BBQ & Ox Bone Soup in Los Angeles _ Japanese CLOUD Pancakes".

root@localhost:~# youtube-dl -j --flat-playlist GbO82vfU4R4  | jq -r '._filename'
BEST KOREAN BBQ & Ox Bone Soup in Los Angeles _ Japanese CLOUD Pancakes-GbO82vfU4R4.webm

Is it possible to set the filename to title correctly?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Oct 16, 2019

Filenames are sanitized. If you wan't a title then you must request a title not a filename.

@dstftw dstftw closed this Oct 16, 2019
@forever8938
Copy link
Author

@forever8938 forever8938 commented Oct 16, 2019

not a filename.

The filename is actually wrong.

root@localhost:~# youtube-dl -i -o '%(title)s' GbO82vfU4R4 
[youtube] GbO82vfU4R4: Downloading webpage
[youtube] GbO82vfU4R4: Downloading video info webpage
[download] Destination: BEST KOREAN BBQ & Ox Bone Soup in Los Angeles _ Japanese CLOUD Pancakes.f313
[download]   3.1% of 1.68GiB at 53.01MiB/s ETA 00:31^C
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Oct 16, 2019

Again: filenames are sanitized.

@ytdl-org ytdl-org locked and limited conversation to collaborators Oct 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.