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

With custom "-o" template: ERROR: Insufficient system charset 'UTF-8' (ver. 2013-08-08) #1209

Closed
zeroxia opened this issue Aug 8, 2013 · 1 comment

Comments

@zeroxia
Copy link

@zeroxia zeroxia commented Aug 8, 2013

Hi,

An error is output if I set a custom filename template:

ERROR: Insufficient system charset 'UTF-8'

Command line is:

youtube-dl --verbose --proxy 'http://127.0.0.1:8080' -o '%(upload_date)-%(id).%(ext)' -f 37 'https://www.youtube.com/watch?v=zjxWpKCQqJc'

Initially the template I used is %(upload_date)-%(id).%(ext), then I tested a simpler one file.%(ext) would produce the same error.

If changing -o TEMPLATE to -o output.mp4, or simply omitting -o option, the command will work.

I have to use a stunnel created local proxy to access youtube, hence the --proxy option.

And I tried the same on a VPS having direct access to youtube, the result is similar:

ERROR: Insufficient system charset 'ANSI_X3.4-1968'
Traceback (most recent call last):
  File "/root/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 261, in prepare_filename
    filename = self.params['outtmpl'] % template_dict
ValueError: incomplete format

Some info:

$ uname -a
Linux kanna 3.10-1-686-pae #1 SMP Debian 3.10.3-1 (2013-07-27) i686 GNU/Linux
$ cat /etc/debian_version 
jessie/sid
$ python --version
Python 2.7.5+

I have no idea if this is related, but here is the system locale command output:

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Dynamic demo:
http://ascii.io/a/4603

@phihag
Copy link
Contributor

@phihag phihag commented Aug 8, 2013

Thank you for the great report! The error message is misleading (fixed); the problem is that the template is invalid. In the Python formatting language, you need an s (or another format character) after parentheses.

Try:

youtube-dl --verbose  -o '%(upload_date)s-%(id)s.%(ext)s' -f 37 zjxWpKCQqJc
@phihag phihag closed this Aug 8, 2013
phihag added a commit that referenced this issue Aug 8, 2013
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.