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

UnicodeDecodeError with 2014.11.04 --write-info-json #4125

Closed
jspiros opened this issue Nov 7, 2014 · 3 comments
Closed

UnicodeDecodeError with 2014.11.04 --write-info-json #4125

jspiros opened this issue Nov 7, 2014 · 3 comments

Comments

@jspiros
Copy link
Contributor

@jspiros jspiros commented Nov 7, 2014

With 2014.11.04, when I run this:

youtube-dl --ignore-errors --no-continue --write-description --write-info-json --write-annotations --write-thumbnail --output "/tmp/test's videos/%(upload_date)s.%(title)s.%(id)s.%(ext)s" --download-archive "/tmp/test's videos/.youtube-dl-archive" "https://www.youtube.com/playlist?list=PLajrxAKXjOIEPYjta8UEOqwWMPmaJwnFK"

I get this:

[youtube:playlist] PLajrxAKXjOIEPYjta8UEOqwWMPmaJwnFK: Downloading webpage
[download] Downloading playlist: youtube-dl bug test playlist
[youtube:playlist] playlist youtube-dl bug test playlist: Collected 1 video ids (downloading 1 of them)
[download] Downloading video #1 of 1
[youtube] Confirming age
[youtube] 2UQWmA4VHC0: Downloading webpage
[youtube] 2UQWmA4VHC0: Downloading video info webpage
[youtube] 2UQWmA4VHC0: Extracting video information
[youtube] 2UQWmA4VHC0: Searching for annotations.
[youtube] 2UQWmA4VHC0: Downloading DASH manifest
[info] Writing video description to: /tmp/test's videos/20140329.cute fox video キツネの鳴き声(キツネ村にて).2UQWmA4VHC0.mp4.description
[info] Writing video annotations to: /tmp/test's videos/20140329.cute fox video キツネの鳴き声(キツネ村にて).2UQWmA4VHC0.mp4.annotations.xml
[info] Writing video description metadata as JSON to: /tmp/test's videos/20140329.cute fox video キツネの鳴き声(キツネ村にて).2UQWmA4VHC0.info.json
ERROR: 'ascii' codec can't decode byte 0xe3 in position 24: ordinal not in range(128)

And when I add -v:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '--ignore-errors', '--no-continue', '--write-description', '--write-info-json', '--write-annotations', '--write-thumbnail', '--output', "/tmp/test's videos/%(upload_date)s.%(title)s.%(id)s.%(ext)s", '--download-archive', "/tmp/test's videos/.youtube-dl-archive", 'https://www.youtube.com/playlist?list=PLajrxAKXjOIEPYjta8UEOqwWMPmaJwnFK']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.11.04
[debug] Python version 2.7.8 - Linux-3.16-2-amd64-x86_64-with-debian-jessie-sid
[debug] exe versions: avconv 11-6, avprobe 11-6
[debug] Proxy map: {}
[youtube:playlist] PLajrxAKXjOIEPYjta8UEOqwWMPmaJwnFK: Downloading webpage
[download] Downloading playlist: youtube-dl bug test playlist
[youtube:playlist] playlist youtube-dl bug test playlist: Collected 1 video ids (downloading 1 of them)
[download] Downloading video #1 of 1
[youtube] Confirming age
[youtube] 2UQWmA4VHC0: Downloading webpage
[youtube] 2UQWmA4VHC0: Downloading video info webpage
[youtube] 2UQWmA4VHC0: Extracting video information
[youtube] 2UQWmA4VHC0: Searching for annotations.
[youtube] 2UQWmA4VHC0: Downloading DASH manifest
[info] Writing video description to: /tmp/test's videos/20140329.cute fox video キツネの鳴き声(キツネ村にて).2UQWmA4VHC0.mp4.description
[info] Writing video annotations to: /tmp/test's videos/20140329.cute fox video キツネの鳴き声(キツネ村にて).2UQWmA4VHC0.mp4.annotations.xml
[info] Writing video description metadata as JSON to: /tmp/test's videos/20140329.cute fox video キツネの鳴き声(キツネ村にて).2UQWmA4VHC0.info.json
ERROR: 'ascii' codec can't decode byte 0xe3 in position 24: ordinal not in range(128)
Traceback (most recent call last):
  File "/home/jspiros/.virtualenvs/youtube-dl-bug-test/local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 547, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/jspiros/.virtualenvs/youtube-dl-bug-test/local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 593, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/home/jspiros/.virtualenvs/youtube-dl-bug-test/local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 861, in process_video_result
    self.process_info(new_info)
  File "/home/jspiros/.virtualenvs/youtube-dl-bug-test/local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 995, in process_info
    write_json_file(info_dict, encodeFilename(infofn))
  File "/home/jspiros/.virtualenvs/youtube-dl-bug-test/local/lib/python2.7/site-packages/youtube_dl/utils.py", line 79, in write_json_file
    'prefix': os.path.basename(fn) + '.',
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 24: ordinal not in range(128)

I have no idea why this is happening. I see no reason for this to be happening on line 79 of utils.py, at least. I inspected the fn variable immediately before that line of code, and I see no reason for os.path.basename(fn) + '.' to cause this exception.

@kenorb
Copy link

@kenorb kenorb commented Nov 10, 2014

The same for 9FvvfB5rfAg, 5VMzsZ5UqV8 and CGDJ6tKzrbI:

ERROR: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal not in range(128)
@jaimeMF jaimeMF closed this in ec5f601 Nov 15, 2014
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 15, 2014

Thanks a lot for the report!, it will work in the next version.

@phihag
Copy link
Contributor

@phihag phihag commented Nov 20, 2014

Fixed in youtube-dl 2014.11.20. See our FAQ if you have problems updating.

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