1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 00:25:08 +00:00

[core] Deprecate internal Youtubedl-no-compression header (#6876)

Authored by: coletdjnz
This commit is contained in:
coletdjnz
2023-05-21 10:55:09 +12:00
committed by GitHub
parent 69bec6730e
commit 955c89584b
6 changed files with 23 additions and 24 deletions

View File

@ -161,3 +161,13 @@ def register_socks_protocols():
for scheme in ('socks', 'socks4', 'socks4a', 'socks5'):
if scheme not in urllib.parse.uses_netloc:
urllib.parse.uses_netloc.append(scheme)
def handle_youtubedl_headers(headers):
filtered_headers = headers
if 'Youtubedl-no-compression' in filtered_headers:
filtered_headers = {k: v for k, v in filtered_headers.items() if k.lower() != 'accept-encoding'}
del filtered_headers['Youtubedl-no-compression']
return filtered_headers