zotify-dev / zotify

A fast and customizable music and podcast downloader.
zlib License
1.2k stars 91 forks source link

lyrics are not getting fetched (for all songs, even ones that actually have lyrics on spotify) #120

Closed iop0p closed 6 months ago

iop0p commented 6 months ago

Spotify API Error (unknown): received an empty response

Skipping lyrics for /song name/

FlyingButteryTuna commented 6 months ago

Adding a user-agent header in zotify.py seems to fix it for me

@classmethod
    def get_auth_header(cls):
        return {
            'Authorization': f'Bearer {cls.__get_auth_token()}',
            'Accept-Language': f'{cls.CONFIG.get_language()}',
            'Accept': 'application/json',
            'app-platform': 'WebPlayer',
            'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
        }
AdamRopelewski commented 6 months ago

Very easy and actually working fix. Thanks

iop0p commented 6 months ago

can confirm it works thanks @FlyingButteryTuna

snehilshah commented 1 month ago

So can I edit this in my existing installation?

Edit: So in my installation with pipx on ubuntu was on path: /home/<username>/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify, check where your installation method installs zotify