nathom / streamrip

A scriptable music downloader for Qobuz, Tidal, SoundCloud, and Deezer
GNU General Public License v3.0
2.6k stars 227 forks source link

[BUG] Genres in French when downloading from Qobuz #618

Open disconnect78 opened 8 months ago

disconnect78 commented 8 months ago

Describe the bug

When downloading from Qobuz, the genre tag is populated with a list of genres in French. Take for example:

https://www.qobuz.com/gb-en/album/katy-j-pearson-friends-presents-songs-from-the-wicker-man-katy-j-pearson/celzwtj750ojc

The genre on the page is Alternative & Indie. However the download files have the genre listed as Pop, Rock, Alternatif et Indé. I can see that this is being pulled from genres_list in the response; if instead it's taken from genres.name then it will be a single genre in English (as displayed on the album page)

I made the following change to metadata/album.py in a local copy which does this. I haven't raised a PR however as I don't know if there's some cases where this wouldn't work.

    def from_qobuz(cls, resp: dict) -> AlbumMetadata:
        album = resp.get("title", "Unknown Album")
        tracktotal = resp.get("tracks_count", 1)
        genre = [safe_get(resp, "genre", "name")] or resp.get("genre") or []
        date = resp.get("release_date_original") or resp.get("release_date")
        ...

Command Used

rip -vvv url https://www.qobuz.com/nz-en/album/katy-j-pearson-friends-presents-songs-from-the-wicker-man-katy-j-pearson/celzwtj750ojc

Debug Traceback

...
[14:06:05] DEBUG    Pending tracks: [PendingTrack(id=232060106,                album.py:92
                    album=AlbumMetadata(info=AlbumInfo(id='232060105',                    
                    quality=3, container='FLAC', label='Heavenly Recordings',             
                    explicit=False, sampling_rate=48, bit_depth=24,                       
                    booklets=None), album='Katy J Pearson & Friends Presents              
                    Songs From The Wicker Man', albumartist='Katy J Pearson',             
                    year='2023', genre=['Alternatif et Indé', 'Rock', 'Pop'],             
                    covers=Covers(('original',                                            
                    'https://static.qobuz.com/images/covers/jc/0o/celzwtj750oj            
                    c_org.jpg', './Katy J Pearson - Katy J Pearson & Friends              
                    Presents Songs From The Wicker Man (2023) [FLAC]                      
                    [24B-48kHz] [232060105]/cover.jpg')                                   
                    ('large',                                                             
                    'https://static.qobuz.com/images/covers/jc/0o/celzwtj750oj            
                    c_600.jpg', './Katy J Pearson - Katy J Pearson & Friends              
                    Presents Songs From The Wicker Man (2023) [FLAC]                      
                    [24B-48kHz]                                                           
                    [232060105]/__artwork/cover-7571210534207939033.jpg')                 
                    ('small',                                                             
                    'https://static.qobuz.com/images/covers/jc/0o/celzwtj750oj            
                    c_230.jpg', None)                                                     
                    ('thumbnail',                                                         
                    'https://static.qobuz.com/images/covers/jc/0o/celzwtj750oj            
                    c_50.jpg', None)), tracktotal=9, disctotal=1,                         
                    albumcomposer='Paul Giovanni', comment=None,                          
                    compilation=None, copyright='2023 Heavenly Recordings                 
                    Under Exclusive License to [PIAS] 2023 Heavenly Recordings            
                    Under Exclusive License to [PIAS]', date='2023-10-31',                
                    description=None, encoder=None, grouping=None,                        
                    lyrics=None, purchase_date=None),                                     
                    client=<streamrip.client.qobuz.QobuzClient object at                  
                    0x120e1d610>, config=<streamrip.config.Config object at               
                    0x104634c50>, folder='./Katy J Pearson - Katy J Pearson &             
                    Friends Presents Songs From The Wicker Man (2023) [FLAC]              
                    [24B-48kHz] [232060105]',                                             
                    db=Database(downloads=<streamrip.db.Dummy object at                   
                    0x120e06d10>, failed=<streamrip.db.Failed object at                   
                    0x120e06bd0>), cover_path='./Katy J Pearson - Katy J                  
                    Pearson & Friends Presents Songs From The Wicker Man                  
                    (2023) [FLAC] [24B-48kHz]                                             
                    [232060105]/__artwork/cover-7571210534207939033.jpg'),                
...
[14:06:19] DEBUG    Tagging with [('TITLE', 'Fire Leap'), ('ARTIST', 'Katy J tagger.py:253
                    Pearson'), ('ALBUM', 'Katy J Pearson & Friends Presents               
                    Songs From The Wicker Man'), ('ALBUMARTIST', 'Katy J                  
                    Pearson'), ('COMPOSER', 'Paul Giovanni'), ('YEAR',                    
                    '2023'), ('GENRE', 'Alternatif et Indé, Rock, Pop'),                  
                    ('COPYRIGHT', '2023 Heavenly Recordings Under Exclusive               
                    License to [PIAS] 2023 Heavenly Recordings Under                      
                    Exclusive License to [PIAS]'), ('TRACKNUMBER', '01'),                 
                    ('DISCNUMBER', '01'), ('TRACKTOTAL', '09'),                           
                    ('DISCTOTAL', '01'), ('DATE', '2023-10-31'), ('ISRC',                 
                    'GBPVV2300370')]

Config File

n/a [not dependent on config]

Operating System

macOS

streamrip version

2.0.5

Screenshots and recordings

No response

Additional context

No response

gaddarkerim commented 7 months ago

Have same issue with Deezer. Where "Various Artists" showed as "Çeşitli Sanatçılar" in metadata which is translation to TR. Alternative becomes Alternatif.

laurensspitzner commented 6 months ago

Same here, running version 2.0.5 on macOS. I have tried the workaround from disconnect78, which does work fine. Although I would love be able to get multiple genres listed.