]> jfr.im git - yt-dlp.git/commit
[networking] Rewrite architecture (#2861)
authorcoletdjnz <redacted>
Sat, 15 Jul 2023 10:25:23 +0000 (15:55 +0530)
committerpukkandan <redacted>
Sat, 15 Jul 2023 10:48:35 +0000 (16:18 +0530)
commit227bf1a33be7b89cd7d44ad046844c4ccba104f4
tree72ffa5e9135e7e4869c351bd9dec6c0944cfba17
parentc365dba8430ee33abda85d31f95128605bf240eb
[networking] Rewrite architecture (#2861)

New networking interface consists of a `RequestDirector` that directs
each `Request` to appropriate `RequestHandler` and returns the
`Response` or raises `RequestError`. The handlers define adapters to
transform its internal Request/Response/Errors to our interfaces.

User-facing changes:
- Fix issues with per request proxies on redirects for urllib
- Support for `ALL_PROXY` environment variable for proxy setting
- Support for `socks5h` proxy
   - Closes https://github.com/yt-dlp/yt-dlp/issues/6325, https://github.com/ytdl-org/youtube-dl/issues/22618, https://github.com/ytdl-org/youtube-dl/pull/28093
- Raise error when using `https` proxy instead of silently converting it to `http`

Authored by: coletdjnz
16 files changed:
test/test_download.py
test/test_networking.py
test/test_networking_utils.py [new file with mode: 0644]
test/test_utils.py
yt_dlp/YoutubeDL.py
yt_dlp/compat/__init__.py
yt_dlp/downloader/http.py
yt_dlp/extractor/common.py
yt_dlp/networking/__init__.py
yt_dlp/networking/_helper.py
yt_dlp/networking/_urllib.py
yt_dlp/networking/common.py [new file with mode: 0644]
yt_dlp/networking/exceptions.py
yt_dlp/utils/_deprecated.py
yt_dlp/utils/_utils.py
yt_dlp/utils/networking.py