Merge pull request #159 from yiannisha/fix#154

Added 'user-library-read' token for saved tracks fixes#154
This commit is contained in:
Logykk 2021-10-28 20:50:32 +13:00 committed by GitHub
commit 983fd79877
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -72,6 +72,8 @@ USER_READ_EMAIL = 'user-read-email'
PLAYLIST_READ_PRIVATE = 'playlist-read-private' PLAYLIST_READ_PRIVATE = 'playlist-read-private'
USER_LIBRARY_READ = 'user-library-read'
WINDOWS_SYSTEM = 'Windows' WINDOWS_SYSTEM = 'Windows'
CREDENTIALS_JSON = 'credentials.json' CREDENTIALS_JSON = 'credentials.json'

View File

@ -18,7 +18,7 @@ from librespot.core import Session
from const import CREDENTIALS_JSON, TYPE, \ from const import CREDENTIALS_JSON, TYPE, \
PREMIUM, USER_READ_EMAIL, AUTHORIZATION, OFFSET, LIMIT, CONFIG_FILE_PATH, FORCE_PREMIUM, \ PREMIUM, USER_READ_EMAIL, AUTHORIZATION, OFFSET, LIMIT, CONFIG_FILE_PATH, FORCE_PREMIUM, \
PLAYLIST_READ_PRIVATE, CONFIG_DEFAULT_SETTINGS PLAYLIST_READ_PRIVATE, USER_LIBRARY_READ, CONFIG_DEFAULT_SETTINGS
from utils import MusicFormat from utils import MusicFormat
@ -74,7 +74,7 @@ class ZSpotify:
@classmethod @classmethod
def __get_auth_token(cls): def __get_auth_token(cls):
return cls.SESSION.tokens().get_token(USER_READ_EMAIL, PLAYLIST_READ_PRIVATE).access_token return cls.SESSION.tokens().get_token(USER_READ_EMAIL, PLAYLIST_READ_PRIVATE, USER_LIBRARY_READ).access_token
@classmethod @classmethod
def get_auth_header(cls): def get_auth_header(cls):