1
mirror of https://github.com/yt-dlp/yt-dlp synced 2024-12-20 00:35:54 +01:00
yt-dlp/youtube_dl
Yen Chi Hsuan c047270c02 [utils] Remove Content-encoding from headers after decompression
With cn_verification_proxy, our http_response() is called twice, one from
PerRequestProxyHandler.proxy_open() and another from normal
YoutubeDL.urlopen(). As a result, for proxies honoring Accept-Encoding, the
following bug occurs:

$ youtube-dl -vs --cn-verification-proxy https://secure.uku.im:993 "test:letv"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-vs', '--cn-verification-proxy', 'https://secure.uku.im:993', 'test:letv']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.12.23
[debug] Git HEAD: 97f18fa
[debug] Python version 3.5.1 - Linux-4.3.3-1-ARCH-x86_64-with-arch-Arch-Linux
[debug] exe versions: ffmpeg 2.8.4, ffprobe 2.8.4, rtmpdump 2.4
[debug] Proxy map: {}
[TestURL] Test URL: http://www.letv.com/ptv/vplay/22005890.html
[Letv] 22005890: Downloading webpage
[Letv] 22005890: Downloading playJson data
ERROR: Unable to download JSON metadata: Not a gzipped file (b'{"') (caused by OSError('Not a gzipped file (b\'{"\')',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "/home/yen/Executables/Multimedia/youtube-dl/youtube_dl/extractor/common.py", line 330, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/home/yen/Executables/Multimedia/youtube-dl/youtube_dl/YoutubeDL.py", line 1886, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.5/urllib/request.py", line 471, in open
    response = meth(req, response)
  File "/home/yen/Executables/Multimedia/youtube-dl/youtube_dl/utils.py", line 773, in http_response
    raise original_ioerror
  File "/home/yen/Executables/Multimedia/youtube-dl/youtube_dl/utils.py", line 761, in http_response
    uncompressed = io.BytesIO(gz.read())
  File "/usr/lib/python3.5/gzip.py", line 274, in read
    return self._buffer.read(size)
  File "/usr/lib/python3.5/gzip.py", line 461, in read
    if not self._read_gzip_header():
  File "/usr/lib/python3.5/gzip.py", line 409, in _read_gzip_header
    raise OSError('Not a gzipped file (%r)' % magic)
2015-12-28 01:09:18 +08:00
..
downloader Rename error_to_str to error_to_compat_str 2015-12-20 07:00:39 +06:00
extractor [vgtv] fix f4m downloading(fixes #7843) 2015-12-27 17:44:55 +01:00
postprocessor [FFmpegPostProcessor] Default of prefer ffmpeg 2015-12-09 20:56:00 -03:00
__init__.py Using internal opener 2015-11-10 17:15:23 +02:00
__main__.py Use insert for all sys.path manipulations 2015-09-26 22:04:41 +02:00
aes.py [aes] Fix for python 3.2 2015-05-22 00:06:10 +06:00
cache.py [cache] Fix writing to paths with unicode characters 2014-11-19 00:02:24 +01:00
compat.py Rename compat_urllib_request_Request to sanitized_Request and move to utils 2015-11-23 21:55:15 +06:00
jsinterp.py [jsinterp] Extend function regex (Closes #7900, closes #7901) 2015-12-18 18:57:49 +06:00
options.py [options] Changed wording for --list-formats 2015-11-28 14:14:20 +08:00
swfinterp.py Fix imports and general cleanup 2014-12-13 12:35:45 +01:00
update.py Use proper encoding on compat_str construction when necessary 2015-12-20 06:29:36 +06:00
utils.py [utils] Remove Content-encoding from headers after decompression 2015-12-28 01:09:18 +08:00
version.py release 2015.12.23 2015-12-23 14:05:06 +01:00
YoutubeDL.py Rename error_to_str to error_to_compat_str 2015-12-20 07:00:39 +06:00