feat(dl): add --proxy-download for a separate download proxy

Manifest, licence and auth stay on --proxy; track, subtitle and attachment downloads use the second proxy. Also exposed as proxy_download on the REST download job with the same server_proxy gate. The download session now ignores HTTP(S)_PROXY and copies rnet cookies set by name.
This commit is contained in:
imSp4rky
2026-09-13 14:41:01 -06:00
parent e40421a855
commit a0515f8d57
12 changed files with 156 additions and 15 deletions
+6 -2
View File
@@ -102,6 +102,7 @@ class Attachment:
session: Optional[AnySession] = None,
*,
no_proxy_download: bool = False,
proxy_download: Optional[str] = None,
) -> None:
"""Download a URL-backed attachment to the temp directory."""
if self.path is not None or not self.url or DOWNLOAD_LICENCE_ONLY.is_set():
@@ -110,8 +111,11 @@ class Attachment:
from unshackle.core.tracks.track import direct_session
session = session or self.session or requests.Session()
if no_proxy_download and any(session.proxies.values()):
session = direct_session(session)
if no_proxy_download:
if any(session.proxies.values()):
session = direct_session(session)
elif proxy_download:
session = direct_session(session, proxy_download)
download_path = config.directories.temp / (self.file_name or "attachment")
try: