feat(dl): add --no-proxy-download flag

Bypass proxy for segment downloads only. Manifest, license, and auth still use proxy. Faster when CDN is unrestricted but manifest is region-locked.
This commit is contained in:
imSp4rky
2026-05-03 13:18:53 -06:00
parent 21754ad37e
commit d5237371e5
4 changed files with 111 additions and 88 deletions
+11
View File
@@ -495,6 +495,12 @@ class dl:
help="Only use CDM, or only use Key Vaults for retrieval of Decryption Keys.",
)
@click.option("--no-proxy", is_flag=True, default=False, help="Force disable all proxy use.")
@click.option(
"--no-proxy-download",
is_flag=True,
default=False,
help="Bypass proxy for segment downloads only. Manifest, license, and auth still use proxy.",
)
@click.option("--no-folder", is_flag=True, default=False, help="Disable folder creation for TV Shows.")
@click.option(
"--no-source", is_flag=True, default=False, help="Disable the source tag from the output file name and path."
@@ -1032,6 +1038,7 @@ class dl:
export: bool,
cdm_only: Optional[bool],
no_proxy: bool,
no_proxy_download: bool,
no_folder: bool,
no_source: bool,
no_mux: bool,
@@ -1448,6 +1455,9 @@ class dl:
console.log("Skipped chapters as --no-chapters was used...")
title.tracks.chapters = []
if no_proxy_download and any(service.session.proxies.values()):
console.log("Bypassing proxy for downloads as --no-proxy-download was used...")
tracks_label = "Getting Remote Tracks..." if self.is_remote else "Getting Tracks..."
with console.status(tracks_label, spinner="dots"):
try:
@@ -2070,6 +2080,7 @@ class dl:
pool.submit(
track.download,
session=track.session or service.session,
no_proxy_download=no_proxy_download,
prepare_drm=partial(
partial(self.prepare_drm, table=download_table),
track=track,