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

ytsearch fails when it encounters en-dash #5988

Closed
breadcat opened this issue Jun 15, 2015 · 1 comment
Closed

ytsearch fails when it encounters en-dash #5988

breadcat opened this issue Jun 15, 2015 · 1 comment

Comments

@breadcat
Copy link

@breadcat breadcat commented Jun 15, 2015

I'm running:

youtube-dl -x --audio-format=mp3 "ytsearch:Styx – Half-Penny, Two-Penny A.D." --verbose

Which gives me:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-x', u'--audio-format=mp3', u'ytsearch:Styx \u2013 Half-Penny, Two-Penny A.D.', u'--verbose']
[debug] Encodings: locale UTF-8, fs UTF-8, out None, pref UTF-8
[debug] youtube-dl version 2015.06.04.1
[debug] Python version 2.7.9 - Linux-3.16.0-4-amd64-x86_64-with-debian-8.1
[debug] exe versions: ffmpeg 2.6.2, ffprobe 2.6.2, rtmpdump 2.4
[debug] Proxy map: {}
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/bin/youtube-dl/__main__.py", line 19, in <module>
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 405, in main
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 395, in _real_main
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1502, in download
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 650, in extract_info                                                                         
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 273, in extract                                                                       
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 1099, in _real_extract                                                                
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1511, in _get_n_results                                                              
  File "/usr/lib/python2.7/urllib.py", line 1338, in urlencode                                                                                                
    v = quote_plus(str(v))                                                                                                                                    
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 5: ordinal not in range(128)

If I replace the en-dash (\u2013) with a normal dash (-), it searched and proceeds perfectly.
I'm picking up the en-dash character from a 'now playing' section of a radio stations web page.

@dstftw dstftw closed this in 02175a7 Jun 15, 2015
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 15, 2015

This issue will be fixed in the next version. Thanks for the report.

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.