fix(backend): download via default client (web_music media 403s); add optional proxy

The PO token provider works (web_music gets a token) but web_music's media URLs
still 403 from a datacenter IP. Prefer the default player clients for the
DOWNLOAD (their URLs go through with a PO token), keeping web_music only as a
fallback for Art-Track extraction; the YTM search still leads with web_music.

Also add an optional YTDLP_PROXY (--proxy) — the durable fix if the IP stays
flagged (403/429) even with a PO token. Empty → unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Opus 4.8 committed 2026-08-17 17:07:34 +02:00
1 parent 4daf87b550
commit 31d4a72e62
3 files changed
+15 -4

No files matched your search

+1
View File
@@ -535,6 +535,7 @@ app.post('/api/youtube/resolve', async (req, res) => {
'--playlist-items', '1-50',
// PO token provider (if configured) to get past YouTube's datacenter-IP block. Empty → omitted.
...(CONFIG.potProviderUrl ? ['--extractor-args', `youtubepot-bgutilhttp:base_url=${CONFIG.potProviderUrl}`] : []),
...(CONFIG.ytdlpProxy ? ['--proxy', CONFIG.ytdlpProxy] : []),
url,
], { timeout: 45000, maxBuffer: 20 * 1024 * 1024 }, (err, out, stderr) => {
if (err && !out?.trim()) return reject(new Error(stderr?.trim() || err.message));