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*$',