From f275a9831e3c481bc4fd9f7b7cf36fe57cf398c9 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Tue, 31 Mar 2026 21:06:05 -0700 Subject: [PATCH] Strip '- Topic' suffix from YouTube auto-generated channel names (#231) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit YouTube's auto-generated artist channels use the format "Artist - Topic" as the channel name. This suffix was not being stripped during playlist parsing, causing metadata discovery to fail (e.g., searching for "Koven - Topic" instead of "Koven" on iTunes/Deezer). Fixed in all three places where YouTube artist names are cleaned: - web_server.py clean_youtube_artist() — playlist parsing - ui/pages/sync.py clean_youtube_artist() — UI-side parsing - core/youtube_client.py — search result fallback artist extraction --- core/youtube_client.py | 3 +++ ui/pages/sync.py | 1 + web_server.py | 1 + 3 files changed, 5 insertions(+) diff --git a/core/youtube_client.py b/core/youtube_client.py index 5254ccda..b5a423f6 100644 --- a/core/youtube_client.py +++ b/core/youtube_client.py @@ -508,6 +508,9 @@ class YouTubeClient: # Fallback: use uploader/channel as artist if not artist: artist = entry.get('uploader', entry.get('channel', 'Unknown Artist')) + # Strip YouTube auto-generated "- Topic" suffix from channel names + if artist and re.search(r'\s*-\s*Topic\s*$', artist, re.IGNORECASE): + artist = re.sub(r'\s*-\s*Topic\s*$', '', artist, flags=re.IGNORECASE).strip() # Extract file size (estimate from format) file_size = 0 diff --git a/ui/pages/sync.py b/ui/pages/sync.py index 3b217fe1..87f45069 100644 --- a/ui/pages/sync.py +++ b/ui/pages/sync.py @@ -289,6 +289,7 @@ def clean_youtube_artist(artist_string): # Remove common YouTube channel suffixes channel_suffixes = [ + r'\s*-\s*Topic\s*$', # YouTube auto-generated "Topic" channels r'\s*VEVO\s*$', r'\s*Music\s*$', r'\s*Official\s*$', diff --git a/web_server.py b/web_server.py index 3a94dbb4..ed9eab97 100644 --- a/web_server.py +++ b/web_server.py @@ -14872,6 +14872,7 @@ def clean_youtube_artist(artist_string): # Remove common YouTube channel suffixes channel_suffixes = [ + r'\s*-\s*Topic\s*$', # YouTube auto-generated "Topic" channels (e.g. "Koven - Topic") r'\s*VEVO\s*$', r'\s*Music\s*$', r'\s*Official\s*$',