revert: drop the YouTube cookies/PO-token/proxy workarounds (back to pre-saga state)
None of it got downloads working on the flagged datacenter IP (web_music media 403, then 429 rate-limiting), so revert the whole lot to keep things clean: - config.js: remove potProviderUrl + ytdlpProxy - ytdlp.js: remove potArgs/proxyArgs; player_client back to web_music,default - novasonic-server.js: remove pot/proxy args from importer resolve - docker-compose.yml: remove the bgutil-provider service + backend env/plugin/depends_on - CHANGELOG: drop the [2.2] section Kept the one genuine fix: a failed direct-link download now reports failure (moved its note into [2.1]). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
31d4a72e62
commit
635ba8d353
5 files changed
+8
-68
No files matched your search
+4
-21
@@ -134,18 +134,6 @@ async function downloadTrack({ jobId, artist, rawArtist, albumArtist, title, alb
|
||||
// YTM ranking toward a same-named artist's full discography.
|
||||
const query = `${ytmArtist} ${searchTitle}`;
|
||||
|
||||
// YouTube 403s media downloads from datacenter IPs without a PO token. When a provider URL is
|
||||
// configured, point the bgutil-ytdlp-pot-provider plugin at it so yt-dlp fetches a token. Empty
|
||||
// config → no arg → unchanged behaviour.
|
||||
const potArgs = () =>
|
||||
CONFIG.potProviderUrl
|
||||
? ['--extractor-args', `youtubepot-bgutilhttp:base_url=${CONFIG.potProviderUrl}`]
|
||||
: [];
|
||||
|
||||
// Optional proxy — the durable fix when a datacenter IP stays flagged (403/429) even with a PO
|
||||
// token. Route yt-dlp through a residential/rotating proxy via YTDLP_PROXY. Empty → not used.
|
||||
const proxyArgs = () => (CONFIG.ytdlpProxy ? ['--proxy', CONFIG.ytdlpProxy] : []);
|
||||
|
||||
const baseArgs = [
|
||||
'--extract-audio',
|
||||
'--audio-format', CONFIG.audioFmt,
|
||||
@@ -156,13 +144,10 @@ async function downloadTrack({ jobId, artist, rawArtist, albumArtist, title, alb
|
||||
'--newline',
|
||||
// Hard upper size limit — prevents saving a wrong 28-min video as a ~52 MB mp3
|
||||
'--max-filesize', '30M',
|
||||
// For the DOWNLOAD, prefer the default clients (their media URLs go through with a PO token from
|
||||
// a datacenter IP) and keep web_music only as a fallback for Art Tracks that only it can extract.
|
||||
// web_music's own media URLs 403 from datacenter IPs even with a valid PO token. (The YTM *search*
|
||||
// in getYtmVideoUrls still leads with web_music, which is where Art-Track discovery matters.)
|
||||
'--extractor-args', 'youtube:player_client=default,web_music',
|
||||
...potArgs(),
|
||||
...proxyArgs(),
|
||||
// Use the web_music player client (falling back to default) so YouTube Music
|
||||
// "Art Track" / topic uploads are reachable. The android_vr client returns
|
||||
// "This video is not available" for many YTM tracks that play fine in the browser.
|
||||
'--extractor-args', 'youtube:player_client=web_music,default',
|
||||
];
|
||||
|
||||
const spawnYtdlp = (args) => new Promise((resolve, reject) => {
|
||||
@@ -235,8 +220,6 @@ async function downloadTrack({ jobId, artist, rawArtist, albumArtist, title, alb
|
||||
// generic YouTube search and returns unrelated videos instead of the
|
||||
// native Songs shelf (where the actual artist track lives).
|
||||
'--extractor-args', 'youtube:player_client=web_music,default',
|
||||
...potArgs(),
|
||||
...proxyArgs(),
|
||||
], { env: { ...process.env, PYTHONUNBUFFERED: '1' } });
|
||||
proc.stdout.on('data', d => {
|
||||
const text = d.toString();
|
||||
|
||||
Reference in new issue
Block a user