X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=youtube_dl%2Futils.py;h=950cd1a7a0babd08fa3e6d0157da52ec97ccb4bc;hb=457749a703acd73857096544057640925fc546bb;hp=9f49507c1256a707a139bbbba407a2b17d3a87ad;hpb=457ac58cc72a0b7161a0369a8f282f38ff0f2f93;p=youtube-dl.git diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 9f49507c1..950cd1a7a 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -799,6 +799,12 @@ class YoutubeDLHandler(compat_urllib_request.HTTPHandler): del req.headers['User-agent'] req.headers['User-agent'] = req.headers['Youtubedl-user-agent'] del req.headers['Youtubedl-user-agent'] + + if sys.version_info < (2, 7) and '#' in req.get_full_url(): + # Python 2.6 is brain-dead when it comes to fragments + req._Request__original = req._Request__original.partition('#')[0] + req._Request__r_type = req._Request__r_type.partition('#')[0] + return req def http_response(self, req, resp):