fix(proxy): harden system proxy metadata flow

Normalize system proxy values from sysproxy, Windows registry, and environment fallbacks before handing them to download engines.

Apply the resolved proxy to direct metadata probes and yt-dlp media metadata requests so preview and final downloads use the same network path.

Enable reqwest SOCKS support and key media metadata caches by proxy/cookie inputs to avoid stale cross-proxy reuse.
This commit is contained in:
NimBold
2026-07-06 00:41:34 +03:30
parent 017d9cd879
commit c13f993150
6 changed files with 269 additions and 59 deletions
+2 -1
View File
@@ -6,12 +6,13 @@ type FetchMediaMetadataArgs = {
cookieBrowser: string | null;
username: string | null;
password: string | null;
proxy: string | null;
};
const inFlightMediaMetadata = new Map<string, Promise<MediaMetadata>>();
const metadataKey = (args: FetchMediaMetadataArgs) =>
JSON.stringify([args.url, args.cookieBrowser, args.username, args.password]);
JSON.stringify([args.url, args.cookieBrowser, args.username, args.password, args.proxy]);
export const fetchMediaMetadataDeduped = (args: FetchMediaMetadataArgs): Promise<MediaMetadata> => {
const key = metadataKey(args);