spotifywebapiPython 1.0.30__py3-none-any.whl → 1.0.32__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of spotifywebapiPython might be problematic. Click here for more details.
- {spotifywebapiPython-1.0.30.dist-info → spotifywebapiPython-1.0.32.dist-info}/METADATA +1 -1
- {spotifywebapiPython-1.0.30.dist-info → spotifywebapiPython-1.0.32.dist-info}/RECORD +50 -50
- spotifywebapipython/const.py +1 -1
- spotifywebapipython/docs/__init__.html +15 -2
- spotifywebapipython/docs/index.html +2 -2
- spotifywebapipython/docs/search.js +1 -1
- spotifywebapipython/docs/spotifywebapiPython/const.html +3 -3
- spotifywebapipython/docs/spotifywebapiPython/saappmessages.html +2 -2
- spotifywebapipython/docs/spotifywebapiPython/sautils.html +2 -2
- spotifywebapipython/docs/spotifywebapiPython/spotifyapierror.html +2 -2
- spotifywebapipython/docs/spotifywebapiPython/spotifyapimessage.html +2 -2
- spotifywebapipython/docs/spotifywebapiPython/spotifyauthtoken.html +2 -2
- spotifywebapipython/docs/spotifywebapiPython/spotifyclient.html +53 -53
- spotifywebapipython/docs/spotifywebapiPython/spotifydiscovery.html +2 -2
- spotifywebapipython/docs/spotifywebapiPython/spotifywebapiauthenticationerror.html +2 -2
- spotifywebapipython/docs/spotifywebapiPython/spotifywebapierror.html +2 -2
- spotifywebapipython/models/album.py +8 -6
- spotifywebapipython/models/albumpagesaved.py +4 -3
- spotifywebapipython/models/albumpagesimplified.py +4 -3
- spotifywebapipython/models/albumsimplified.py +9 -7
- spotifywebapipython/models/artist.py +8 -6
- spotifywebapipython/models/artistpage.py +4 -3
- spotifywebapipython/models/audiobookpagesimplified.py +4 -3
- spotifywebapipython/models/audiobooksimplified.py +18 -14
- spotifywebapipython/models/category.py +4 -3
- spotifywebapipython/models/categorypage.py +4 -3
- spotifywebapipython/models/chapterpagesimplified.py +4 -3
- spotifywebapipython/models/chaptersimplified.py +6 -5
- spotifywebapipython/models/episodepagesaved.py +4 -3
- spotifywebapipython/models/episodepagesimplified.py +4 -3
- spotifywebapipython/models/episodesimplified.py +5 -4
- spotifywebapipython/models/playerqueueinfo.py +13 -10
- spotifywebapipython/models/playhistorypage.py +4 -3
- spotifywebapipython/models/playlistpage.py +4 -3
- spotifywebapipython/models/playlistpagesimplified.py +4 -3
- spotifywebapipython/models/playlistsimplified.py +4 -3
- spotifywebapipython/models/showpagesaved.py +4 -3
- spotifywebapipython/models/showpagesimplified.py +4 -3
- spotifywebapipython/models/showsimplified.py +10 -8
- spotifywebapipython/models/trackpage.py +4 -3
- spotifywebapipython/models/trackpagesaved.py +4 -3
- spotifywebapipython/models/trackpagesimplified.py +4 -3
- spotifywebapipython/models/trackrecommendations.py +8 -6
- spotifywebapipython/models/tracksimplified.py +5 -4
- spotifywebapipython/models/userprofilesimplified.py +4 -3
- spotifywebapipython/oauthcli/authclient.py +1 -1
- spotifywebapipython/spotifyclient.py +54 -72
- {spotifywebapiPython-1.0.30.dist-info → spotifywebapiPython-1.0.32.dist-info}/LICENSE +0 -0
- {spotifywebapiPython-1.0.30.dist-info → spotifywebapiPython-1.0.32.dist-info}/WHEEL +0 -0
- {spotifywebapiPython-1.0.30.dist-info → spotifywebapiPython-1.0.32.dist-info}/top_level.txt +0 -0
|
@@ -35,9 +35,10 @@ class AlbumPageSimplified(PageObject):
|
|
|
35
35
|
else:
|
|
36
36
|
|
|
37
37
|
# process all collections and objects.
|
|
38
|
-
items:list = root.get('items',
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
items:list = root.get('items',None)
|
|
39
|
+
if items is not None:
|
|
40
|
+
for item in items:
|
|
41
|
+
self._Items.append(AlbumSimplified(root=item))
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
def __repr__(self) -> str:
|
|
@@ -44,7 +44,7 @@ class AlbumSimplified:
|
|
|
44
44
|
else:
|
|
45
45
|
|
|
46
46
|
self._AlbumType = root.get('album_type', None)
|
|
47
|
-
self._AvailableMarkets = root.get('available_markets', []
|
|
47
|
+
self._AvailableMarkets = root.get('available_markets', None) or []
|
|
48
48
|
self._Href = root.get('href', None)
|
|
49
49
|
self._Id = root.get('id', None)
|
|
50
50
|
self._Name = root.get('name', None)
|
|
@@ -55,17 +55,19 @@ class AlbumSimplified:
|
|
|
55
55
|
self._Uri = root.get('uri', None)
|
|
56
56
|
|
|
57
57
|
# process all collections and objects.
|
|
58
|
-
items:list = root.get('artists',
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
items:list = root.get('artists',None)
|
|
59
|
+
if items is not None:
|
|
60
|
+
for item in items:
|
|
61
|
+
self._Artists.append(ArtistSimplified(root=item))
|
|
61
62
|
|
|
62
63
|
item:dict = root.get('external_urls',None)
|
|
63
64
|
if item is not None:
|
|
64
65
|
self._ExternalUrls = ExternalUrls(root=item)
|
|
65
66
|
|
|
66
|
-
items:list = root.get('images',
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
items:list = root.get('images',None)
|
|
68
|
+
if items is not None:
|
|
69
|
+
for item in items:
|
|
70
|
+
self._Images.append(ImageObject(root=item))
|
|
69
71
|
|
|
70
72
|
item:dict = root.get('restrictions',None)
|
|
71
73
|
if item is not None:
|
|
@@ -43,13 +43,15 @@ class Artist(ArtistSimplified):
|
|
|
43
43
|
if item is not None:
|
|
44
44
|
self._Followers = Followers(root=item)
|
|
45
45
|
|
|
46
|
-
items:list[str] = root.get('genres',
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
items:list[str] = root.get('genres',None)
|
|
47
|
+
if items is not None:
|
|
48
|
+
for item in items:
|
|
49
|
+
self._Genres.append(item)
|
|
49
50
|
|
|
50
|
-
items:list = root.get('images',
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
items:list = root.get('images',None)
|
|
52
|
+
if items is not None:
|
|
53
|
+
for item in items:
|
|
54
|
+
self._Images.append(ImageObject(root=item))
|
|
53
55
|
|
|
54
56
|
|
|
55
57
|
def __repr__(self) -> str:
|
|
@@ -35,9 +35,10 @@ class ArtistPage(PageObject):
|
|
|
35
35
|
else:
|
|
36
36
|
|
|
37
37
|
# process all collections and objects.
|
|
38
|
-
items:list = root.get('items',
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
items:list = root.get('items',None)
|
|
39
|
+
if items is not None:
|
|
40
|
+
for item in items:
|
|
41
|
+
self._Items.append(Artist(root=item))
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
def __repr__(self) -> str:
|
|
@@ -35,9 +35,10 @@ class AudiobookPageSimplified(PageObject):
|
|
|
35
35
|
else:
|
|
36
36
|
|
|
37
37
|
# process all collections and objects.
|
|
38
|
-
items:list = root.get('items',
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
items:list = root.get('items',None)
|
|
39
|
+
if items is not None:
|
|
40
|
+
for item in items:
|
|
41
|
+
self._Items.append(AudiobookSimplified(root=item))
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
def __repr__(self) -> str:
|
|
@@ -49,14 +49,14 @@ class AudiobookSimplified:
|
|
|
49
49
|
|
|
50
50
|
else:
|
|
51
51
|
|
|
52
|
-
self._AvailableMarkets = root.get('available_markets', []
|
|
52
|
+
self._AvailableMarkets = root.get('available_markets', None) or []
|
|
53
53
|
self._Description = root.get('description', None)
|
|
54
54
|
self._Edition = root.get('edition', None)
|
|
55
55
|
self._Explicit = root.get('explicit', None)
|
|
56
56
|
self._Href = root.get('href', None)
|
|
57
57
|
self._HtmlDescription = root.get('html_description', None)
|
|
58
58
|
self._Id = root.get('id', None)
|
|
59
|
-
self._Languages = root.get('languages', []
|
|
59
|
+
self._Languages = root.get('languages', None) or []
|
|
60
60
|
self._MediaType = root.get('media_type', None)
|
|
61
61
|
self._Name = root.get('name', None)
|
|
62
62
|
self._Publisher = root.get('publisher', None)
|
|
@@ -65,25 +65,29 @@ class AudiobookSimplified:
|
|
|
65
65
|
self._Uri = root.get('uri', None)
|
|
66
66
|
|
|
67
67
|
# process all collections and objects.
|
|
68
|
-
items:list = root.get('authors',
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
items:list = root.get('authors',None)
|
|
69
|
+
if items is not None:
|
|
70
|
+
for item in items:
|
|
71
|
+
self._Authors.append(Author(root=item))
|
|
71
72
|
|
|
72
|
-
items:list = root.get('copyrights',
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
items:list = root.get('copyrights',None)
|
|
74
|
+
if items is not None:
|
|
75
|
+
for item in items:
|
|
76
|
+
self._Copyrights.append(Copyright(root=item))
|
|
75
77
|
|
|
76
78
|
item:dict = root.get('external_urls',None)
|
|
77
79
|
if item is not None:
|
|
78
80
|
self._ExternalUrls = ExternalUrls(root=item)
|
|
79
81
|
|
|
80
|
-
items:list = root.get('images',
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
items:list = root.get('images',None)
|
|
83
|
+
if items is not None:
|
|
84
|
+
for item in items:
|
|
85
|
+
self._Images.append(ImageObject(root=item))
|
|
83
86
|
|
|
84
|
-
items:list = root.get('narrators',
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
items:list = root.get('narrators',None)
|
|
88
|
+
if items is not None:
|
|
89
|
+
for item in items:
|
|
90
|
+
self._Narrators.append(Narrator(root=item))
|
|
87
91
|
|
|
88
92
|
|
|
89
93
|
def __repr__(self) -> str:
|
|
@@ -36,9 +36,10 @@ class Category:
|
|
|
36
36
|
self._Name = root.get('name', None)
|
|
37
37
|
|
|
38
38
|
# process all collections and objects.
|
|
39
|
-
items:list = root.get('icons',
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
items:list = root.get('icons',None)
|
|
40
|
+
if items is not None:
|
|
41
|
+
for item in items:
|
|
42
|
+
self._Icons.append(ImageObject(root=item))
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
def __repr__(self) -> str:
|
|
@@ -35,9 +35,10 @@ class CategoryPage(PageObject):
|
|
|
35
35
|
else:
|
|
36
36
|
|
|
37
37
|
# process all collections and objects.
|
|
38
|
-
items:list = root.get('items',
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
items:list = root.get('items',None)
|
|
39
|
+
if items is not None:
|
|
40
|
+
for item in items:
|
|
41
|
+
self._Items.append(Category(root=item))
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
def __repr__(self) -> str:
|
|
@@ -35,9 +35,10 @@ class ChapterPageSimplified(PageObject):
|
|
|
35
35
|
else:
|
|
36
36
|
|
|
37
37
|
# process all collections and objects.
|
|
38
|
-
items:list = root.get('items',
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
items:list = root.get('items',None)
|
|
39
|
+
if items is not None:
|
|
40
|
+
for item in items:
|
|
41
|
+
self._Items.append(ChapterSimplified(root=item))
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
def __repr__(self) -> str:
|
|
@@ -50,7 +50,7 @@ class ChapterSimplified:
|
|
|
50
50
|
else:
|
|
51
51
|
|
|
52
52
|
self._AudioPreviewUrl = root.get('audio_preview_url', None)
|
|
53
|
-
self._AvailableMarkets = root.get('available_markets', []
|
|
53
|
+
self._AvailableMarkets = root.get('available_markets', None) or []
|
|
54
54
|
self._ChapterNumber = root.get('chapter_number', None)
|
|
55
55
|
self._Description = root.get('description', None)
|
|
56
56
|
self._DurationMS = root.get('duration_ms', None)
|
|
@@ -59,7 +59,7 @@ class ChapterSimplified:
|
|
|
59
59
|
self._HtmlDescription = root.get('html_description', None)
|
|
60
60
|
self._Id = root.get('id', None)
|
|
61
61
|
self._IsPlayable = root.get('is_playable', None)
|
|
62
|
-
self._Languages = root.get('languages', []
|
|
62
|
+
self._Languages = root.get('languages', None) or []
|
|
63
63
|
self._Name = root.get('name', None)
|
|
64
64
|
self._ReleaseDate = root.get('release_date', None)
|
|
65
65
|
self._ReleaseDatePrecision = root.get('release_date_precision', None)
|
|
@@ -71,9 +71,10 @@ class ChapterSimplified:
|
|
|
71
71
|
if item is not None:
|
|
72
72
|
self._ExternalUrls = ExternalUrls(root=item)
|
|
73
73
|
|
|
74
|
-
items:list = root.get('images',
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
items:list = root.get('images',None)
|
|
75
|
+
if items is not None:
|
|
76
|
+
for item in items:
|
|
77
|
+
self._Images.append(ImageObject(root=item))
|
|
77
78
|
|
|
78
79
|
item:dict = root.get('restrictions',None)
|
|
79
80
|
if item is not None:
|
|
@@ -36,9 +36,10 @@ class EpisodePageSaved(PageObject):
|
|
|
36
36
|
else:
|
|
37
37
|
|
|
38
38
|
# process all collections and objects.
|
|
39
|
-
items:list = root.get('items',
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
items:list = root.get('items',None)
|
|
40
|
+
if items is not None:
|
|
41
|
+
for item in items:
|
|
42
|
+
self._Items.append(EpisodeSaved(root=item))
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
def __repr__(self) -> str:
|
|
@@ -35,9 +35,10 @@ class EpisodePageSimplified(PageObject):
|
|
|
35
35
|
else:
|
|
36
36
|
|
|
37
37
|
# process all collections and objects.
|
|
38
|
-
items:list = root.get('items',
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
items:list = root.get('items',None)
|
|
39
|
+
if items is not None:
|
|
40
|
+
for item in items:
|
|
41
|
+
self._Items.append(EpisodeSimplified(root=item))
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
def __repr__(self) -> str:
|
|
@@ -57,7 +57,7 @@ class EpisodeSimplified:
|
|
|
57
57
|
self._Id = root.get('id', None)
|
|
58
58
|
self._IsExternallyHosted = root.get('is_externally_hosted', None)
|
|
59
59
|
self._IsPlayable = root.get('is_playable', None)
|
|
60
|
-
self._Languages = root.get('languages', []
|
|
60
|
+
self._Languages = root.get('languages', None) or []
|
|
61
61
|
self._Name = root.get('name', None)
|
|
62
62
|
self._ReleaseDate = root.get('release_date', None)
|
|
63
63
|
self._ReleaseDatePrecision = root.get('release_date_precision', None)
|
|
@@ -69,9 +69,10 @@ class EpisodeSimplified:
|
|
|
69
69
|
if item is not None:
|
|
70
70
|
self._ExternalUrls = ExternalUrls(root=item)
|
|
71
71
|
|
|
72
|
-
items:list = root.get('images',
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
items:list = root.get('images',None)
|
|
73
|
+
if items is not None:
|
|
74
|
+
for item in items:
|
|
75
|
+
self._Images.append(ImageObject(root=item))
|
|
75
76
|
|
|
76
77
|
item:dict = root.get('restrictions',None)
|
|
77
78
|
if item is not None:
|
|
@@ -42,13 +42,14 @@ class PlayerQueueInfo:
|
|
|
42
42
|
elif self._CurrentlyPlayingType == 'episode':
|
|
43
43
|
self._CurrentlyPlaying = Episode(root=item)
|
|
44
44
|
|
|
45
|
-
items:list = root.get('queue',
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
items:list = root.get('queue',None)
|
|
46
|
+
if items is not None:
|
|
47
|
+
for item in items:
|
|
48
|
+
itemType = item.get('type','unknown')
|
|
49
|
+
if itemType == 'track':
|
|
50
|
+
self._Queue.append(Track(root=item))
|
|
51
|
+
elif itemType == 'episode':
|
|
52
|
+
self._Queue.append(Episode(root=item))
|
|
52
53
|
|
|
53
54
|
|
|
54
55
|
def __repr__(self) -> str:
|
|
@@ -80,7 +81,9 @@ class PlayerQueueInfo:
|
|
|
80
81
|
@property
|
|
81
82
|
def Queue(self) -> list[object]:
|
|
82
83
|
"""
|
|
83
|
-
|
|
84
|
+
The tracks or episodes in the queue. Can be empty.
|
|
85
|
+
|
|
86
|
+
Will be one of the following: `Track` or `Episode`
|
|
84
87
|
"""
|
|
85
88
|
return self._Queue
|
|
86
89
|
|
|
@@ -112,9 +115,9 @@ class PlayerQueueInfo:
|
|
|
112
115
|
elif self._CurrentlyPlayingType == 'ad':
|
|
113
116
|
result = 'Advertisement'
|
|
114
117
|
|
|
115
|
-
elif self._CurrentlyPlayingType is None
|
|
118
|
+
elif self._CurrentlyPlayingType is None:
|
|
116
119
|
|
|
117
|
-
result =
|
|
120
|
+
result = 'unavailable'
|
|
118
121
|
|
|
119
122
|
return result
|
|
120
123
|
|
|
@@ -36,9 +36,10 @@ class PlayHistoryPage(PageObject):
|
|
|
36
36
|
else:
|
|
37
37
|
|
|
38
38
|
# process all collections and objects.
|
|
39
|
-
items:list = root.get('items',
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
items:list = root.get('items',None)
|
|
40
|
+
if items is not None:
|
|
41
|
+
for item in items:
|
|
42
|
+
self._Items.append(PlayHistory(root=item))
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
def __repr__(self) -> str:
|
|
@@ -36,9 +36,10 @@ class PlaylistPage(PageObject):
|
|
|
36
36
|
else:
|
|
37
37
|
|
|
38
38
|
# process all collections and objects.
|
|
39
|
-
items:list = root.get('items',
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
items:list = root.get('items',None)
|
|
40
|
+
if items is not None:
|
|
41
|
+
for item in items:
|
|
42
|
+
self._Items.append(PlaylistTrack(root=item))
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
def __repr__(self) -> str:
|
|
@@ -35,9 +35,10 @@ class PlaylistPageSimplified(PageObject):
|
|
|
35
35
|
else:
|
|
36
36
|
|
|
37
37
|
# process all collections and objects.
|
|
38
|
-
items:list = root.get('items',
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
items:list = root.get('items',None)
|
|
39
|
+
if items is not None:
|
|
40
|
+
for item in items:
|
|
41
|
+
self._Items.append(PlaylistSimplified(root=item))
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
def __repr__(self) -> str:
|
|
@@ -57,9 +57,10 @@ class PlaylistSimplified:
|
|
|
57
57
|
if item is not None:
|
|
58
58
|
self._ExternalUrls = ExternalUrls(root=item)
|
|
59
59
|
|
|
60
|
-
items:list = root.get('images',
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
items:list = root.get('images',None)
|
|
61
|
+
if items is not None:
|
|
62
|
+
for item in items:
|
|
63
|
+
self._Images.append(ImageObject(root=item))
|
|
63
64
|
|
|
64
65
|
item:dict = root.get('owner',None)
|
|
65
66
|
if item is not None:
|
|
@@ -36,9 +36,10 @@ class ShowPageSaved(PageObject):
|
|
|
36
36
|
else:
|
|
37
37
|
|
|
38
38
|
# process all collections and objects.
|
|
39
|
-
items:list = root.get('items',
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
items:list = root.get('items',None)
|
|
40
|
+
if items is not None:
|
|
41
|
+
for item in items:
|
|
42
|
+
self._Items.append(ShowSaved(root=item))
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
def __repr__(self) -> str:
|
|
@@ -35,9 +35,10 @@ class ShowPageSimplified(PageObject):
|
|
|
35
35
|
else:
|
|
36
36
|
|
|
37
37
|
# process all collections and objects.
|
|
38
|
-
items:list = root.get('items',
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
items:list = root.get('items',None)
|
|
39
|
+
if items is not None:
|
|
40
|
+
for item in items:
|
|
41
|
+
self._Items.append(ShowSimplified(root=item))
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
def __repr__(self) -> str:
|
|
@@ -45,14 +45,14 @@ class ShowSimplified:
|
|
|
45
45
|
|
|
46
46
|
else:
|
|
47
47
|
|
|
48
|
-
self._AvailableMarkets = root.get('available_markets', []
|
|
48
|
+
self._AvailableMarkets = root.get('available_markets', None) or []
|
|
49
49
|
self._Description = root.get('description', None)
|
|
50
50
|
self._Explicit = root.get('explicit', None)
|
|
51
51
|
self._Href = root.get('href', None)
|
|
52
52
|
self._HtmlDescription = root.get('html_description', None)
|
|
53
53
|
self._Id = root.get('id', None)
|
|
54
54
|
self._IsExternallyHosted = root.get('is_externally_hosted', None)
|
|
55
|
-
self._Languages = root.get('languages', []
|
|
55
|
+
self._Languages = root.get('languages', None) or []
|
|
56
56
|
self._MediaType = root.get('media_type', None)
|
|
57
57
|
self._Name = root.get('name', None)
|
|
58
58
|
self._Publisher = root.get('publisher', None)
|
|
@@ -61,17 +61,19 @@ class ShowSimplified:
|
|
|
61
61
|
self._Uri = root.get('uri', None)
|
|
62
62
|
|
|
63
63
|
# process all collections and objects.
|
|
64
|
-
items:list = root.get('copyrights',
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
items:list = root.get('copyrights',None)
|
|
65
|
+
if items is not None:
|
|
66
|
+
for item in items:
|
|
67
|
+
self._Copyrights.append(Copyright(root=item))
|
|
67
68
|
|
|
68
69
|
item:dict = root.get('external_urls',None)
|
|
69
70
|
if item is not None:
|
|
70
71
|
self._ExternalUrls = ExternalUrls(root=item)
|
|
71
72
|
|
|
72
|
-
items:list = root.get('images',
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
items:list = root.get('images',None)
|
|
74
|
+
if items is not None:
|
|
75
|
+
for item in items:
|
|
76
|
+
self._Images.append(ImageObject(root=item))
|
|
75
77
|
|
|
76
78
|
|
|
77
79
|
def __repr__(self) -> str:
|
|
@@ -35,9 +35,10 @@ class TrackPage(PageObject):
|
|
|
35
35
|
else:
|
|
36
36
|
|
|
37
37
|
# process all collections and objects.
|
|
38
|
-
items:list = root.get('items',
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
items:list = root.get('items',None)
|
|
39
|
+
if items is not None:
|
|
40
|
+
for item in items:
|
|
41
|
+
self._Items.append(Track(root=item))
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
def __repr__(self) -> str:
|
|
@@ -36,9 +36,10 @@ class TrackPageSaved(PageObject):
|
|
|
36
36
|
else:
|
|
37
37
|
|
|
38
38
|
# process all collections and objects.
|
|
39
|
-
items:list = root.get('items',
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
items:list = root.get('items',None)
|
|
40
|
+
if items is not None:
|
|
41
|
+
for item in items:
|
|
42
|
+
self._Items.append(TrackSaved(root=item))
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
def __repr__(self) -> str:
|
|
@@ -35,9 +35,10 @@ class TrackPageSimplified(PageObject):
|
|
|
35
35
|
else:
|
|
36
36
|
|
|
37
37
|
# process all collections and objects.
|
|
38
|
-
items:list = root.get('items',
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
items:list = root.get('items',None)
|
|
39
|
+
if items is not None:
|
|
40
|
+
for item in items:
|
|
41
|
+
self._Items.append(TrackSimplified(root=item))
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
def __repr__(self) -> str:
|
|
@@ -30,13 +30,15 @@ class TrackRecommendations:
|
|
|
30
30
|
else:
|
|
31
31
|
|
|
32
32
|
# process all collections and objects.
|
|
33
|
-
items:list = root.get('seeds',
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
items:list = root.get('seeds',None)
|
|
34
|
+
if items is not None:
|
|
35
|
+
for item in items:
|
|
36
|
+
self._Seeds.append(RecommendationSeed(root=item))
|
|
36
37
|
|
|
37
|
-
items:list = root.get('tracks',
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
items:list = root.get('tracks',None)
|
|
39
|
+
if items is not None:
|
|
40
|
+
for item in items:
|
|
41
|
+
self._Tracks.append(Track(root=item))
|
|
40
42
|
|
|
41
43
|
|
|
42
44
|
def __repr__(self) -> str:
|
|
@@ -45,7 +45,7 @@ class TrackSimplified:
|
|
|
45
45
|
|
|
46
46
|
else:
|
|
47
47
|
|
|
48
|
-
self._AvailableMarkets = root.get('available_markets', []
|
|
48
|
+
self._AvailableMarkets = root.get('available_markets', None) or []
|
|
49
49
|
self._DiscNumber = root.get('disc_number', None)
|
|
50
50
|
self._DurationMS = root.get('duration_ms', None)
|
|
51
51
|
self._Explicit = root.get('explicit', None)
|
|
@@ -60,9 +60,10 @@ class TrackSimplified:
|
|
|
60
60
|
self._Uri = root.get('uri', None)
|
|
61
61
|
|
|
62
62
|
# process all collections and objects.
|
|
63
|
-
items:list = root.get('artists',
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
items:list = root.get('artists',None)
|
|
64
|
+
if items is not None:
|
|
65
|
+
for item in items:
|
|
66
|
+
self._Artists.append(ArtistSimplified(root=item))
|
|
66
67
|
|
|
67
68
|
item:dict = root.get('external_urls',None)
|
|
68
69
|
if item is not None:
|
|
@@ -54,9 +54,10 @@ class UserProfileSimplified:
|
|
|
54
54
|
if item is not None:
|
|
55
55
|
self._Followers = Followers(root=item)
|
|
56
56
|
|
|
57
|
-
items:list = root.get('images',
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
items:list = root.get('images',None)
|
|
58
|
+
if items is not None:
|
|
59
|
+
for item in items:
|
|
60
|
+
self._Images.append(ImageObject(root=item))
|
|
60
61
|
|
|
61
62
|
UNKNOWN:str = 'unknown'
|
|
62
63
|
|
|
@@ -648,7 +648,7 @@ class AuthClient:
|
|
|
648
648
|
arrScopeSession.sort()
|
|
649
649
|
|
|
650
650
|
if token is not None and isinstance(token, dict):
|
|
651
|
-
arrScopeToken = token.get('scope', []
|
|
651
|
+
arrScopeToken = token.get('scope', None) or []
|
|
652
652
|
if isinstance(arrScopeToken, str):
|
|
653
653
|
arrScopeToken = arrScopeSession.split(' ')
|
|
654
654
|
arrScopeToken.sort()
|