[generic] Convert redirect URLs to unicode strings (closes #13951)
authorSergey M․ <dstftw@gmail.com>
Thu, 17 Aug 2017 16:57:48 +0000 (23:57 +0700)
committerSergey M․ <dstftw@gmail.com>
Thu, 17 Aug 2017 16:58:01 +0000 (23:58 +0700)
youtube_dl/extractor/generic.py

index eff5fbfe8c2da8a34ddb381af191bf5100e9a99d..d2fb2627db856cdf4be849a6ceee2c007ac36dcc 100644 (file)
@@ -2015,7 +2015,7 @@ class GenericIE(InfoExtractor):
 
         if head_response is not False:
             # Check for redirect
-            new_url = head_response.geturl()
+            new_url = compat_str(head_response.geturl())
             if url != new_url:
                 self.report_following_redirect(new_url)
                 if force_videoid:
@@ -2116,7 +2116,7 @@ class GenericIE(InfoExtractor):
             elif re.match(r'(?i)^(?:{[^}]+})?MPD$', doc.tag):
                 info_dict['formats'] = self._parse_mpd_formats(
                     doc, video_id,
-                    mpd_base_url=full_response.geturl().rpartition('/')[0],
+                    mpd_base_url=compat_str(full_response.geturl()).rpartition('/')[0],
                     mpd_url=url)
                 self._sort_formats(info_dict['formats'])
                 return info_dict