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.
"TypeError: must be unicode, not str" when using --write-description #7178
Comments
|
there is probably some strange non-ascii characters in the string not being recognized |
|
Ok, Is there an option to strip or ignore these non-ascii characters ? |
|
The problem is that on python 2.x |
|
What if we just add a recursive auto decoding for all bytestrings in |
|
I prefer what @jaimeMF said, that is, requiring all string fields in By the way, for @sebma As of current the simplest workaround is running youtube-dl with Python 3. For example:
|
|
Conventionally we require it, but don't check it anywhere. Fixing this in extractors will involve fixing almost every extractor that uses |
|
In #7296 I have wrapped every call to |
|
why can't you force UTF-8/16? when grabbing the file? this is what i use with wget to get rid of non iso-8859-1 characters. |
|
Closing since #7296 landed. This functionality will work on both Python 2 and Python 3 in the next version. |
Hi, I have the following error :
"TypeError: must be unicode, not str"
The command I typed is the following :
youtube-dl --verbose --ignore-config --write-description http://www.veoh.com/watch/v46093745wbEGkakh
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'--ignore-config', u'--write-description', u'http://www.veoh.com/watch/v46093745wbEGkakh']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.10.13
[debug] Python version 2.7.8 - Linux-3.16.0-44-generic-x86_64-with-Ubuntu-14.10-utopic
[debug] exe versions: avconv 11.2-6, avprobe 11.2-6, ffmpeg 2.6.2, ffprobe 2.6.2, rtmpdump 2.4
[debug] Proxy map: {}
[Veoh] v46093745wbEGkakh: Downloading video XML
[info] Writing video description to: Pirates Of Silicon Valley-46093745.description
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/init.py", line 410, in main
real_main(argv)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/_init.py", line 400, in _real_main
retcode = ydl.download(all_urls)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1665, in download
url, force_generic_extractor=self.params.get('force_generic_extractor', False))
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 671, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 717, in process_ie_result
return self.process_video_result(ie_result, download=download)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1335, in process_video_result
self.process_info(new_info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1465, in process_info
descfile.write(info_dict['description'])
TypeError: must be unicode, not str
Any idea ?
Seb.