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

UnicodeEncodeError when i try to download Videos #258

Closed
scheff2804 opened this issue Dec 22, 2011 · 3 comments
Closed

UnicodeEncodeError when i try to download Videos #258

scheff2804 opened this issue Dec 22, 2011 · 3 comments
Assignees

Comments

@scheff2804
Copy link

@scheff2804 scheff2804 commented Dec 22, 2011

Hi there,

i try to download Videos with the following command
youtube-dl --title --continue --max-quality 37 --batch-file=FILE -i
It worked fine until an error occurs :

[youtube] Setting language
[youtube] PFI-gAAQyjM: Downloading video webpage
[youtube] PFI-gAAQyjM: Downloading video info webpage
[youtube] PFI-gAAQyjM: Extracting video information
Traceback (most recent call last):
File "/usr/bin/youtube-dl", line 4514, in
main()
File "/usr/bin/youtube-dl", line 4505, in main
_real_main()
File "/usr/bin/youtube-dl", line 4489, in _real_main
retcode = fd.download(all_urls)
File "/usr/bin/youtube-dl", line 840, in download
ie.extract(url)
File "/usr/bin/youtube-dl", line 1098, in extract
return self._real_extract(url)
File "/usr/bin/youtube-dl", line 1427, in _real_extract
'player_url': player_url,
File "/usr/bin/youtube-dl", line 807, in process_info
success = self._do_download(filename, info_dict)
File "/usr/bin/youtube-dl", line 901, in _do_download
if self.params.get('continuedl', False) and os.path.isfile(filename) and not self.params.get('nopart', False):
File "/usr/lib/python2.6/genericpath.py", line 29, in isfile
st = os.stat(path)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 15: ordinal not in range(128)

Any idea?

Regards Chris

@ghost ghost assigned phihag Dec 22, 2011
@phihag
Copy link
Contributor

@phihag phihag commented Dec 23, 2011

Unfortunately, I could not reproduce this with

$ python2.6 youtube-dl  --title --continue PFI-gAAQyjM

Could you post the output of locale ? On my system, it's

$ locale
LANG=
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=en_US.UTF-8

I'll have an idea what might cause the problem though, and will investigate it once I have the time.

@scheff2804
Copy link
Author

@scheff2804 scheff2804 commented Dec 23, 2011

:-)
The idea was right :)
After typing :
nano /etc/env.d/02locale
and adding
LC_CTYPE=de_DE.UTF-8
and
env-update && source /etc/profile
it works :)
Thanks for the Idea

Locale before:
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

Regards Chris

@phihag
Copy link
Contributor

@phihag phihag commented Jan 8, 2012

This should be fixed even when the locale is POSIX (by removing characters we cannot represent) in youtube-dl 2012.01.08b.

@phihag phihag closed this Jan 8, 2012
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.