sigma67 / ytmusicapi

Unofficial API for YouTube Music
https://ytmusicapi.readthedocs.io
MIT License
1.59k stars 183 forks source link

Fix OAUTH_CUSTOM_FULL mode #527

Closed MarvinSchenkel closed 5 months ago

MarvinSchenkel commented 5 months ago

This PR adds the missing AuthType.OAUTH_CUSTOM_FULL mode when calculating the headers. We (Music Assistant) use our own web-based OAuth process to retrieve an acces token. In this scenario we also provide the other required headers to interact with Youtube Music.

MarvinSchenkel commented 5 months ago

Good point! In that case I would need to make some changes to this line, as the token is None for full custom oauth: https://github.com/sigma67/ytmusicapi/blob/917019745723d6ffacc32d7eb8c2676e5debba0c/ytmusicapi/ytmusic.py#L215. This currently throws an error.

sigma67 commented 5 months ago

Yeah, is it enough to just not set authorization if self.auth_type == AuthType.OAUTH_CUSTOM_FULL: ?

MarvinSchenkel commented 5 months ago

Yeah, is it enough to just not set authorization if self.auth_type == AuthType.OAUTH_CUSTOM_FULL: ?

Absolutely, fixed that

sigma67 commented 5 months ago

@MarvinSchenkel please submit to main next time, master is no longer used

MarvinSchenkel commented 5 months ago

@MarvinSchenkel please submit to main next time, master is no longer used

Sorry I wasn't aware. My existing fork was still pointing to master.

sigma67 commented 5 months ago

I deleted the master branch in this repo so this can't happen anymore 👍

(don't worry I'll push your commit shortly)