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

SoundCloud doesn't work for tracks with unicode titles #1474

Closed
ddevault opened this issue Sep 21, 2013 · 4 comments
Closed

SoundCloud doesn't work for tracks with unicode titles #1474

ddevault opened this issue Sep 21, 2013 · 4 comments

Comments

@ddevault
Copy link

@ddevault ddevault commented Sep 21, 2013

https://soundcloud.com/yamazaru/clarity-feat-foxes-mushup-zedd

$ youtube-dl https://soundcloud.com/yamazaru/clarity-feat-foxes-mushup-zedd
[soundcloud] yamazaru/clarity-feat-foxes-mushup-zedd: Resolving id
[soundcloud] yamazaru/clarity-feat-foxes-mushup-zedd: Downloading info JSON
[soundcloud] yamazaru/clarity-feat-foxes-mushup-zedd: Extracting information
Traceback (most recent call last):
  File "/usr/bin/youtube-dl", line 6, in <module>
    youtube_dl.main()
  File "/usr/lib/python3.3/site-packages/youtube_dl/__init__.py", line 671, in main
    _real_main(argv)
  File "/usr/lib/python3.3/site-packages/youtube_dl/__init__.py", line 655, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/lib/python3.3/site-packages/youtube_dl/YoutubeDL.py", line 571, in download
    videos = self.extract_info(url)
  File "/usr/lib/python3.3/site-packages/youtube_dl/YoutubeDL.py", line 336, in extract_info
    return self.process_ie_result(ie_result, download=download)
  File "/usr/lib/python3.3/site-packages/youtube_dl/YoutubeDL.py", line 366, in process_ie_result
    self.process_info(ie_result)
  File "/usr/lib/python3.3/site-packages/youtube_dl/YoutubeDL.py", line 546, in process_info
    success = self.fd._do_download(filename, info_dict)
  File "/usr/lib/python3.3/site-packages/youtube_dl/FileDownloader.py", line 376, in _do_download
    if self.params.get('continuedl', False) and os.path.isfile(encodeFilename(filename)) and not self.params.get('nopart', False):
  File "/usr/lib/python3.3/genericpath.py", line 29, in isfile
    st = os.stat(path)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 21-29: ordinal not in range(128)
@phihag
Copy link
Contributor

@phihag phihag commented Sep 21, 2013

This error is unrelated to soundcloud, it is a filesytem misconfiguration - your system only supports ASCII filenames. What system is this? On a debian sid with en_US locale, everything works fine for me. Also, can you post the outputs of

python -c 'import sys;print(sys.getfilesystemencoding())'

and

env

?

@ddevault
Copy link
Author

@ddevault ddevault commented Sep 21, 2013

This is on arch, with an ext4 filesystem. I'm using the en_us locale. Well, at least I think I am.

$ python -c 'import sys;print(sys.getfilesystemencoding())'
ascii
$ env
XDG_VTNR=1
XDG_SESSION_ID=1
TERMINATOR_UUID=urn:uuid:2fc63e30-6151-4a57-a990-abbc29afdf31
ANDROID_HOME=/opt/android-sdk
SHELL=/bin/bash
TERM=xterm
ANDROID_SWT=/usr/share/java
WINDOWID=48234500
USER=sircmpwn
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/sircmpwn/:/home/sircmpwn/bin:/home/sircmpwn/sources/dotfiles/scripts/:/opt/android-sdk/platform-tools/:/home/sircmpwn/.gem/ruby/2.0.0/bin
MAIL=/var/spool/mail/sircmpwn
PWD=/home/sircmpwn
JAVA_HOME=/usr/lib/jvm/java-7-openjdk/jre
LANG=C
PS1=[omitted]
SHLVL=4
XDG_SEAT=seat0
HOME=/home/sircmpwn
LOGNAME=sircmpwn
TERMINAL=terminator
WINDOWPATH=1
DISPLAY=:0
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=/home/sircmpwn/.Xauthority
COLORTERM=gnome-terminal
_=/usr/bin/env
@ddevault
Copy link
Author

@ddevault ddevault commented Sep 21, 2013

Hey, you're right, my system is busted up. Sorry for wasting your time.

@ddevault ddevault closed this Sep 21, 2013
phihag added a commit that referenced this issue Sep 21, 2013
@phihag
Copy link
Contributor

@phihag phihag commented Sep 21, 2013

Well, youtube-dl should still work on a system without a locale. Added code to that effect - it now automatically switches to removing non-ASCII characters and prints out a warning with instructions on how to fix it.

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.