fix: suppress ytmsearch unsupported scheme error, clean up search log
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
595fb2b7f3
commit
626a755688
1 file changed
+6
-3
@@ -228,17 +228,20 @@ async function downloadTrack({ jobId, artist, albumArtist, title, album, year, t
|
|||||||
fs.readdirSync(dir).filter(f => AUDIO_EXTS.some(e => f.endsWith(`.${e}`))).length;
|
fs.readdirSync(dir).filter(f => AUDIO_EXTS.some(e => f.endsWith(`.${e}`))).length;
|
||||||
|
|
||||||
// Step 1: YouTube Music — music-specific index, far fewer false positives
|
// Step 1: YouTube Music — music-specific index, far fewer false positives
|
||||||
log(jobId, `🎵 YouTube Music: "${query}"`);
|
// Falls silently if this yt-dlp version doesn't support ytmsearch (older Alpine package)
|
||||||
const countBefore = audioFileCount();
|
const countBefore = audioFileCount();
|
||||||
try {
|
try {
|
||||||
|
log(jobId, `🎵 YouTube Music: "${query}"`);
|
||||||
await runYtdlp(`ytmsearch:${query}`);
|
await runYtdlp(`ytmsearch:${query}`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(jobId, `⚠️ YouTube Music Fehler: ${e.message}`);
|
if (!e.message.includes('Unsupported url scheme')) {
|
||||||
|
log(jobId, `⚠️ YouTube Music Fehler: ${e.message}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 2: Fallback to regular YouTube if no file was produced
|
// Step 2: Fallback to regular YouTube if no file was produced
|
||||||
if (audioFileCount() === countBefore) {
|
if (audioFileCount() === countBefore) {
|
||||||
log(jobId, `🔄 Fallback: YouTube (5 Ergebnisse) — "${query}"`);
|
log(jobId, `🔍 YouTube: "${query}"`);
|
||||||
await runYtdlp(`ytsearch5:${query}`);
|
await runYtdlp(`ytsearch5:${query}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user