Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
UnicodeEncodeError when adding metadata to the output file #9292
Comments
|
Add |
|
Output via lighttpd log:
I suspect it has something to do with locales. Seems like the necessary env vars don't get passed on to python when it's called. Both I solved it by adding this to my lighttpd config:
|
|
In the latest CPython diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index f333e47..08a5154 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -486,10 +486,6 @@ def encodeFilename(s, for_subprocess=False):
assert type(s) == compat_str
- # Python 3 has a Unicode API
- if sys.version_info >= (3, 0):
- return s
-
# Pass '' directly to use Unicode APIs on Windows 2000 and up
# (Detecting Windows NT 4 is tricky because 'major >= 4' would
# match Windows 9x series as well. Besides, NT 4 is obsolete.)Before:
After:
|
Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2016.04.19. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue
If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:
Add
-vflag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):Description of your issue, suggested solution and other information
When I try to download something from Soundcloud (could also be other sites) that has unicode characters in its description, the following error occurs on line 163 in youtube-dl/postprocessor/ffmpeg.py in run_ffmpeg_multiple_files:
UnicodeEncodeError: 'ascii' codec can't encode character '\u21bb' in position 86: ordinal not in range(128)
The parameter cmd contains:
Weirdly, this never happens when using the CLI OR calling the cgi script directly. However, I don't get how this could be caused by lighttpd either...