From e15ca65874b2a8bcd7435696b8f01252c39512ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?0x=E2=88=85?= Date: Sat, 3 Jan 2026 05:47:38 +0530 Subject: [PATCH] [ie/twitch:videos] Raise error when channel is not found (#15458) Closes #15450 Authored by: 0xvd --- yt_dlp/extractor/twitch.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yt_dlp/extractor/twitch.py b/yt_dlp/extractor/twitch.py index 5e87e92070..24e510a983 100644 --- a/yt_dlp/extractor/twitch.py +++ b/yt_dlp/extractor/twitch.py @@ -680,6 +680,10 @@ class TwitchPlaylistBaseIE(TwitchBaseIE): }], f'Downloading {self._NODE_KIND}s GraphQL page {page_num}', fatal=False) + # Avoid extracting random/unrelated entries when channel_name doesn't exist + # See https://github.com/yt-dlp/yt-dlp/issues/15450 + if traverse_obj(page, (0, 'data', 'user', 'id', {str})) == '': + raise ExtractorError(f'Channel "{channel_name}" not found', expected=True) if not page: break edges = try_get(