Decode the reason given on YouTube errors to avoid crashes (fixes issue #193)
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sat, 21 Aug 2010 22:48:55 +0000 (00:48 +0200)
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sun, 31 Oct 2010 10:28:41 +0000 (11:28 +0100)
youtube-dl

index d7b30adca282702af2f2ef08b2470ab75dcddbf8..c850f26b34c3629ae2ee13c62f33a6c27f801a82 100755 (executable)
@@ -849,7 +849,7 @@ class YoutubeIE(InfoExtractor):
                                return
                if 'token' not in video_info:
                        if 'reason' in video_info:
-                               self._downloader.trouble(u'ERROR: YouTube said: %s' % video_info['reason'][0])
+                               self._downloader.trouble(u'ERROR: YouTube said: %s' % video_info['reason'][0].decode('utf-8'))
                        else:
                                self._downloader.trouble(u'ERROR: "token" parameter not in video info for unknown reason')
                        return