UnicodeEncodeError when i try to download Videos #180

Closed
opened 2026-02-20 22:27:24 -05:00 by deekerman · 3 comments
Owner

Originally created by @scheff2804 on GitHub (Dec 22, 2011).

Originally assigned to: @phihag on GitHub.

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

Originally created by @scheff2804 on GitHub (Dec 22, 2011). Originally assigned to: @phihag on GitHub. 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 <module> 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
Author
Owner

@phihag commented on GitHub (Dec 22, 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.

@phihag commented on GitHub (Dec 22, 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.
Author
Owner

@scheff2804 commented on GitHub (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

@scheff2804 commented on GitHub (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
Author
Owner

@phihag commented on GitHub (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 commented on GitHub (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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#180
No description provided.