Fall back to SoundCloud when YouTube hides search results

YouTube applies restricted-mode filtering to programmatic search: the
same query that returns a clip in a signed-in browser comes back as an
empty list over the API, with exit code 0 and no message at all, and
cookies do not change it. Verified locally — "gudium идол" returns three
results, "gudium аудиопорно" returns none, and so does the plain
youtube.com/results page for the same words.

An empty YouTube search now retries on SoundCloud, and when both come up
empty the message says the query may have been filtered and suggests
pasting a link, instead of implying the track does not exist.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Leonid PershinandClaude Opus 5 committed 2026-09-09 00:07:20 +03:00
1 parent 3e53f34374
commit f84489e27e
5 files changed
+405 -373

No files matched your search

+1 -1
View File
@@ -76,7 +76,7 @@ export function SearchPanel({ serverId, canControl, localLibrary, onError }: Pro
{results.length === 0 ? (
<div className="empty">
{searched
? `По запросу «${query}» ничего не нашлось`
? `По запросу «${query}» ничего не нашлось. YouTube иногда прячет результаты от ботов — попробуйте другие слова или вставьте прямую ссылку на трек.`
: lastAdded
? `Добавлено: ${lastAdded}`
: "Введите запрос или вставьте ссылку — плейлисты тоже поддерживаются."}