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

--postprocessor-args crash after characters like á etc... #9871

Closed
xabixab opened this issue Jun 23, 2016 · 6 comments
Closed

--postprocessor-args crash after characters like á etc... #9871

xabixab opened this issue Jun 23, 2016 · 6 comments
Labels
bug

Comments

@xabixab
Copy link

@xabixab xabixab commented Jun 23, 2016

  • I've verified and I assure that I'm running youtube-dl 2016.06.23.1
  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Bug report (encountered problems with youtube-dl)

$ youtube-dl -v --ignore-config -q -x --audio-format mp3 --audio-quality 128K --prefer-ffmpeg --postprocessor-args "-metadata title='Heroes - B.o.Y Remix' -metadata album='Heroes - Remixes' -metadata author='Måns Zelmerlöw' " --output "/tmp/Måns Zelmerlöw - Heroes - B.o.Y Remix.mp3" https://www.youtube.com/watch?v=5BD38kj-4B0
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'--ignore-config', u'-q', u'-x', u'--audio-format', u'mp3', u'--audio-quality', u'128K', u'--prefer-ffmpeg', u'--postprocessor-args', u"-metadata title='Heroes - B.o.Y Remix' -metadata album='Heroes - Remixes' -metadata author='M\xe5ns Zelmerl\xf6w' ", u'--output', u'/tmp/M\xe5ns Zelmerl\xf6w - Heroes - B.o.Y Remix.mp3', u'https://www.youtube.com/watch?v=5BD38kj-4B0']
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/__init__.py", line 420, in main
    _real_main(argv)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/__init__.py", line 275, in _real_main
    postprocessor_args = compat_shlex_split(opts.postprocessor_args)
  File "/usr/lib/python2.7/shlex.py", line 275, in split
    lex = shlex(s, posix=posix)
  File "/usr/lib/python2.7/shlex.py", line 25, in __init__
    instream = StringIO(instream)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5' in position 93: ordinal not in range(128)

if you pass characters like áöé etc.. youtube-dl crashes.

I have tried changing the line of the file /youtube_dl/init.py
from

        postprocessor_args = compat_shlex_split(opts.postprocessor_args)

to

        postprocessor_args = compat_shlex_split(opts.postprocessor_args.encode("utf8"))

After this change, youtube-dl don't crash but the arguments are not passed to the postprocessor.
I need to add custom metadata, so i can't do with --add-metadata

I have found this ( #9292 ) issue but didn't work for me.

I am running the last version.

$ youtube-dl --version
2016.06.23.1

Reproducible on python 2 under Linux.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 23, 2016

Post the output of youtube-dl -v.

@xabixab
Copy link
Author

@xabixab xabixab commented Jun 23, 2016

Here it goes

$ youtube-dl -v
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.06.23.1
[debug] Python version 2.7.11+ - Linux-4.4.0-24-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv N-78590-g5590ab4, avprobe N-78590-g5590ab4, ffmpeg N-78590-g5590ab4, ffprobe N-78590-g5590ab4, rtmpdump 2.4
[debug] Proxy map: {}
Usage: youtube-dl [OPTIONS] URL [URL...]

youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.

@xabixab
Copy link
Author

@xabixab xabixab commented Jun 23, 2016

can't reproduce?
try just with

youtube-dl --postprocessor-args á

it makes the same effect.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 23, 2016

> py -2.7 -m youtube_dl -v --postprocessor-args á
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'--postprocessor-args', u'a']
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
[debug] youtube-dl version 2016.06.23.1
[debug] Git HEAD: 8065d6c
[debug] Python version 2.7.11 - Windows-10-10.0.10240
[debug] exe versions: ffmpeg 3.0, ffprobe 3.0, rtmpdump 2.4
[debug] Proxy map: {}
Usage: __main__.py [OPTIONS] URL [URL...]

__main__.py: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.
@xabixab
Copy link
Author

@xabixab xabixab commented Jun 23, 2016

I think that it's because you have tried from windows.

@dstftw dstftw removed the cant-reproduce label Jun 23, 2016
@yan12125 yan12125 added the bug label Jun 24, 2016
@yan12125 yan12125 closed this in dfe5fa4 Jul 7, 2016
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 7, 2016

Thanks for the report and sorry for the delay. Should be fixed in the next version.

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