From 91f24a81f2812cc3195f17a5308119cee5b2c435 Mon Sep 17 00:00:00 2001 From: logykk Date: Wed, 28 Dec 2022 23:49:18 +1300 Subject: [PATCH] add scope for followed artists --- CHANGELOG.md | 4 ++++ setup.cfg | 2 +- zotify/config.py | 2 +- zotify/const.py | 2 ++ zotify/zotify.py | 6 ++++-- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee6a80a..8b5aedb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.6.11 +- Add new scope for reading followed artists +- Print API errors by default + ## 0.6.10 - Fix cover art size once and for all diff --git a/setup.cfg b/setup.cfg index f4d68cd..32946e0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = zotify -version = 0.6.10 +version = 0.6.11 author = Zotify Contributors description = A highly customizable music and podcast downloader long_description = file: README.md diff --git a/zotify/config.py b/zotify/config.py index b56581d..ff7e929 100644 --- a/zotify/config.py +++ b/zotify/config.py @@ -65,7 +65,7 @@ CONFIG_VALUES = { PRINT_DOWNLOAD_PROGRESS: { 'default': 'True', 'type': bool, 'arg': '--print-download-progress' }, PRINT_ERRORS: { 'default': 'True', 'type': bool, 'arg': '--print-errors' }, PRINT_DOWNLOADS: { 'default': 'False', 'type': bool, 'arg': '--print-downloads' }, - PRINT_API_ERRORS: { 'default': 'False', 'type': bool, 'arg': '--print-api-errors' }, + PRINT_API_ERRORS: { 'default': 'True', 'type': bool, 'arg': '--print-api-errors' }, PRINT_PROGRESS_INFO: { 'default': 'True', 'type': bool, 'arg': '--print-progress-info' }, PRINT_WARNINGS: { 'default': 'True', 'type': bool, 'arg': '--print-warnings' }, TEMP_DOWNLOAD_DIR: { 'default': '', 'type': str, 'arg': '--temp-download-dir' } diff --git a/zotify/const.py b/zotify/const.py index 98f42c5..770f6be 100644 --- a/zotify/const.py +++ b/zotify/const.py @@ -84,6 +84,8 @@ WIDTH = 'width' USER_READ_EMAIL = 'user-read-email' +USER_FOLLOW_READ = 'user-follow-read' + PLAYLIST_READ_PRIVATE = 'playlist-read-private' USER_LIBRARY_READ = 'user-library-read' diff --git a/zotify/zotify.py b/zotify/zotify.py index 27fc5d0..943b4e7 100644 --- a/zotify/zotify.py +++ b/zotify/zotify.py @@ -8,7 +8,7 @@ from librespot.core import Session from zotify.const import TYPE, \ PREMIUM, USER_READ_EMAIL, OFFSET, LIMIT, \ - PLAYLIST_READ_PRIVATE, USER_LIBRARY_READ + PLAYLIST_READ_PRIVATE, USER_LIBRARY_READ, USER_FOLLOW_READ from zotify.config import Config class Zotify: @@ -54,7 +54,9 @@ class Zotify: @classmethod def __get_auth_token(cls): - return cls.SESSION.tokens().get_token(USER_READ_EMAIL, PLAYLIST_READ_PRIVATE, USER_LIBRARY_READ).access_token + return cls.SESSION.tokens().get_token( + USER_READ_EMAIL, PLAYLIST_READ_PRIVATE, USER_LIBRARY_READ, USER_FOLLOW_READ + ).access_token @classmethod def get_auth_header(cls):