Strip '- Topic' suffix from YouTube auto-generated channel names (#231)
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
This commit is contained in:
parent
34c8b1bb50
commit
f275a9831e
3 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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*$',
|
||||
|
|
|
|||
|
|
@ -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*$',
|
||||
|
|
|
|||
Loading…
Reference in a new issue