spotifywebapiPython 1.0.242__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.
- spotifywebapipython/__init__.py +35 -0
- spotifywebapipython/const.py +114 -0
- spotifywebapipython/docs/__init__.html +2156 -0
- spotifywebapipython/docs/codecopy.js +70 -0
- spotifywebapipython/docs/index.html +514 -0
- spotifywebapipython/docs/search.js +46 -0
- spotifywebapipython/docs/spotifywebapipython/const.html +636 -0
- spotifywebapipython/docs/spotifywebapipython/saappmessages.html +540 -0
- spotifywebapipython/docs/spotifywebapipython/sautils.html +620 -0
- spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html +341 -0
- spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html +598 -0
- spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html +612 -0
- spotifywebapipython/docs/spotifywebapipython/spotifyclient.html +16557 -0
- spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html +518 -0
- spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html +421 -0
- spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html +400 -0
- spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html +635 -0
- spotifywebapipython/docs/spotifywebapipython.ico +0 -0
- spotifywebapipython/docs/spotifywebapipython_OLD.ico +0 -0
- spotifywebapipython/models/__init__.py +121 -0
- spotifywebapipython/models/album.py +170 -0
- spotifywebapipython/models/albumpagesaved.py +85 -0
- spotifywebapipython/models/albumpagesimplified.py +88 -0
- spotifywebapipython/models/albumsaved.py +102 -0
- spotifywebapipython/models/albumsimplified.py +308 -0
- spotifywebapipython/models/artist.py +146 -0
- spotifywebapipython/models/artistinfo.py +282 -0
- spotifywebapipython/models/artistinfotourevent.py +127 -0
- spotifywebapipython/models/artistpage.py +70 -0
- spotifywebapipython/models/artistsimplified.py +163 -0
- spotifywebapipython/models/audiobook.py +87 -0
- spotifywebapipython/models/audiobookpagesimplified.py +88 -0
- spotifywebapipython/models/audiobooksimplified.py +362 -0
- spotifywebapipython/models/audiofeatures.py +333 -0
- spotifywebapipython/models/author.py +67 -0
- spotifywebapipython/models/category.py +168 -0
- spotifywebapipython/models/categorypage.py +70 -0
- spotifywebapipython/models/chapter.py +84 -0
- spotifywebapipython/models/chapterpagesimplified.py +88 -0
- spotifywebapipython/models/chaptersimplified.py +387 -0
- spotifywebapipython/models/context.py +113 -0
- spotifywebapipython/models/copyright.py +79 -0
- spotifywebapipython/models/device.py +301 -0
- spotifywebapipython/models/episode.py +84 -0
- spotifywebapipython/models/episodepagesaved.py +85 -0
- spotifywebapipython/models/episodepagesimplified.py +88 -0
- spotifywebapipython/models/episodesaved.py +99 -0
- spotifywebapipython/models/episodesimplified.py +370 -0
- spotifywebapipython/models/explicitcontent.py +80 -0
- spotifywebapipython/models/externalids.py +91 -0
- spotifywebapipython/models/externalurls.py +104 -0
- spotifywebapipython/models/followers.py +81 -0
- spotifywebapipython/models/imageobject.py +193 -0
- spotifywebapipython/models/imagevibrantcolors.py +182 -0
- spotifywebapipython/models/linkedfrom.py +165 -0
- spotifywebapipython/models/narrator.py +67 -0
- spotifywebapipython/models/owner.py +162 -0
- spotifywebapipython/models/pageobject.py +343 -0
- spotifywebapipython/models/playeractions.py +196 -0
- spotifywebapipython/models/playerlastplayedinfo.py +334 -0
- spotifywebapipython/models/playerplaystate.py +467 -0
- spotifywebapipython/models/playerqueueinfo.py +207 -0
- spotifywebapipython/models/playhistory.py +136 -0
- spotifywebapipython/models/playhistorypage.py +85 -0
- spotifywebapipython/models/playlist.py +125 -0
- spotifywebapipython/models/playlistpage.py +85 -0
- spotifywebapipython/models/playlistpagesimplified.py +107 -0
- spotifywebapipython/models/playlistsimplified.py +334 -0
- spotifywebapipython/models/playlisttrack.py +143 -0
- spotifywebapipython/models/playlisttracksummary.py +80 -0
- spotifywebapipython/models/recommendationseed.py +135 -0
- spotifywebapipython/models/restrictions.py +86 -0
- spotifywebapipython/models/resumepoint.py +79 -0
- spotifywebapipython/models/searchresponse.py +391 -0
- spotifywebapipython/models/searchresultbase.py +299 -0
- spotifywebapipython/models/show.py +87 -0
- spotifywebapipython/models/showpagesaved.py +85 -0
- spotifywebapipython/models/showpagesimplified.py +88 -0
- spotifywebapipython/models/showsaved.py +99 -0
- spotifywebapipython/models/showsimplified.py +320 -0
- spotifywebapipython/models/spotifyconnectdevice.py +321 -0
- spotifywebapipython/models/spotifyconnectdevices.py +441 -0
- spotifywebapipython/models/track.py +142 -0
- spotifywebapipython/models/trackpage.py +110 -0
- spotifywebapipython/models/trackpagesaved.py +85 -0
- spotifywebapipython/models/trackpagesimplified.py +88 -0
- spotifywebapipython/models/trackrecommendations.py +88 -0
- spotifywebapipython/models/tracksaved.py +99 -0
- spotifywebapipython/models/tracksimplified.py +398 -0
- spotifywebapipython/models/userprofile.py +184 -0
- spotifywebapipython/models/userprofilesimplified.py +206 -0
- spotifywebapipython/models/zeroconfdiscoveryresult.py +592 -0
- spotifywebapipython/models/zeroconfproperty.py +93 -0
- spotifywebapipython/oauthcli/__init__.py +7 -0
- spotifywebapipython/oauthcli/authclient.py +1229 -0
- spotifywebapipython/saappmessages.py +86 -0
- spotifywebapipython/sautils.py +285 -0
- spotifywebapipython/spotifyapierror.py +66 -0
- spotifywebapipython/spotifyapimessage.py +269 -0
- spotifywebapipython/spotifyauthtoken.py +264 -0
- spotifywebapipython/spotifyclient.py +17885 -0
- spotifywebapipython/spotifyconnect/__init__.py +19 -0
- spotifywebapipython/spotifyconnect/spotifyconnectdeviceeventargs.py +67 -0
- spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py +2564 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastapptask.py +467 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastcontroller.py +701 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastlistener.py +359 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastmultizonelistener.py +212 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfexceptions.py +20 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconflistener.py +335 -0
- spotifywebapipython/spotifydiscovery.py +473 -0
- spotifywebapipython/spotifymediatypes.py +53 -0
- spotifywebapipython/spotifywebapiauthenticationerror.py +122 -0
- spotifywebapipython/spotifywebapierror.py +106 -0
- spotifywebapipython/spotifywebplayertoken.py +743 -0
- spotifywebapipython/vibrant/__init__.py +17 -0
- spotifywebapipython/vibrant/generator.py +261 -0
- spotifywebapipython/vibrant/image.py +100 -0
- spotifywebapipython/vibrant/main.py +34 -0
- spotifywebapipython/vibrant/models.py +93 -0
- spotifywebapipython/vibrant/utils.py +56 -0
- spotifywebapipython/zeroconfapi/__init__.py +23 -0
- spotifywebapipython/zeroconfapi/authenticationtypes.py +38 -0
- spotifywebapipython/zeroconfapi/blobbuilder.py +370 -0
- spotifywebapipython/zeroconfapi/credentials.py +37 -0
- spotifywebapipython/zeroconfapi/cryptodiffiehellman.py +89 -0
- spotifywebapipython/zeroconfapi/helpers.py +64 -0
- spotifywebapipython/zeroconfapi/spotifyzeroconfapierror.py +108 -0
- spotifywebapipython/zeroconfapi/zeroconfconnect.py +1327 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfo.py +572 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfoalias.py +109 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfodrmmediaformat.py +90 -0
- spotifywebapipython/zeroconfapi/zeroconfresponse.py +195 -0
- spotifywebapipython-1.0.242.dist-info/LICENSE +22 -0
- spotifywebapipython-1.0.242.dist-info/METADATA +219 -0
- spotifywebapipython-1.0.242.dist-info/RECORD +138 -0
- spotifywebapipython-1.0.242.dist-info/WHEEL +5 -0
- spotifywebapipython-1.0.242.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# external package imports.
|
|
2
|
+
|
|
3
|
+
# our package imports.
|
|
4
|
+
from ..sautils import export
|
|
5
|
+
from .audiobooksimplified import AudiobookSimplified
|
|
6
|
+
from .chapterpagesimplified import ChapterPageSimplified
|
|
7
|
+
|
|
8
|
+
@export
|
|
9
|
+
class Audiobook(AudiobookSimplified):
|
|
10
|
+
"""
|
|
11
|
+
Spotify Web API Audiobook object.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, root:dict=None) -> None:
|
|
15
|
+
"""
|
|
16
|
+
Initializes a new instance of the class.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
root (dict):
|
|
20
|
+
Spotify Web API JSON response in dictionary format, used to load object
|
|
21
|
+
attributes; otherwise, None to not load attributes.
|
|
22
|
+
"""
|
|
23
|
+
# initialize base class.
|
|
24
|
+
super().__init__(root=root)
|
|
25
|
+
|
|
26
|
+
self._Chapters:ChapterPageSimplified = None
|
|
27
|
+
|
|
28
|
+
if (root is None):
|
|
29
|
+
|
|
30
|
+
pass
|
|
31
|
+
|
|
32
|
+
else:
|
|
33
|
+
|
|
34
|
+
# process all collections and objects.
|
|
35
|
+
item:dict = root.get('chapters',None)
|
|
36
|
+
if item is not None:
|
|
37
|
+
self._Chapters = ChapterPageSimplified(root=item)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def __repr__(self) -> str:
|
|
41
|
+
return self.ToString()
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def __str__(self) -> str:
|
|
45
|
+
return self.ToString()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def Chapters(self) -> ChapterPageSimplified:
|
|
50
|
+
"""
|
|
51
|
+
The chapters of the audiobook.
|
|
52
|
+
|
|
53
|
+
This is a `ChapterPageSimplified` object.
|
|
54
|
+
"""
|
|
55
|
+
return self._Chapters
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def ToDictionary(self) -> dict:
|
|
59
|
+
"""
|
|
60
|
+
Returns a dictionary representation of the class.
|
|
61
|
+
"""
|
|
62
|
+
# get base class result.
|
|
63
|
+
resultBase:dict = super().ToDictionary()
|
|
64
|
+
|
|
65
|
+
chapters:dict = {}
|
|
66
|
+
if self._Chapters is not None:
|
|
67
|
+
chapters = self._Chapters.ToDictionary()
|
|
68
|
+
|
|
69
|
+
result:dict = \
|
|
70
|
+
{
|
|
71
|
+
'chapters': chapters
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
# combine base class results with these results.
|
|
75
|
+
resultBase.update(result)
|
|
76
|
+
|
|
77
|
+
# return a sorted dictionary.
|
|
78
|
+
return resultBase
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def ToString(self) -> str:
|
|
82
|
+
"""
|
|
83
|
+
Returns a displayable string representation of the class.
|
|
84
|
+
"""
|
|
85
|
+
msg:str = 'Audiobook: %s' % super().ToString(False)
|
|
86
|
+
if self._Chapters is not None: msg = '%s\n Chapter Count=%s' % (msg, str(self._Chapters.Total))
|
|
87
|
+
return msg
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# external package imports.
|
|
2
|
+
|
|
3
|
+
# our package imports.
|
|
4
|
+
from ..sautils import export
|
|
5
|
+
from .audiobooksimplified import AudiobookSimplified
|
|
6
|
+
from .pageobject import PageObject
|
|
7
|
+
|
|
8
|
+
@export
|
|
9
|
+
class AudiobookPageSimplified(PageObject):
|
|
10
|
+
"""
|
|
11
|
+
Spotify Web API SimplifiedAudiobookPage object.
|
|
12
|
+
|
|
13
|
+
This allows for multiple pages of `AudiobookSimplified` objects to be navigated.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
def __init__(self, root:dict=None) -> None:
|
|
17
|
+
"""
|
|
18
|
+
Initializes a new instance of the class.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
root (dict):
|
|
22
|
+
Spotify Web API JSON response in dictionary format, used to load object
|
|
23
|
+
attributes; otherwise, None to not load attributes.
|
|
24
|
+
"""
|
|
25
|
+
# initialize base class.
|
|
26
|
+
super().__init__(root=root)
|
|
27
|
+
|
|
28
|
+
# initialize storage.
|
|
29
|
+
self._Items:list[AudiobookSimplified] = []
|
|
30
|
+
|
|
31
|
+
if (root is None):
|
|
32
|
+
|
|
33
|
+
self._Total = 0
|
|
34
|
+
|
|
35
|
+
else:
|
|
36
|
+
|
|
37
|
+
# process all collections and objects.
|
|
38
|
+
items:list = root.get('items',None)
|
|
39
|
+
if items is not None:
|
|
40
|
+
for item in items:
|
|
41
|
+
if item is not None:
|
|
42
|
+
self._Items.append(AudiobookSimplified(root=item))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def __repr__(self) -> str:
|
|
46
|
+
return self.ToString()
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def __str__(self) -> str:
|
|
50
|
+
return self.ToString()
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def Items(self) -> list[AudiobookSimplified]:
|
|
55
|
+
"""
|
|
56
|
+
Array of `AudiobookSimplified` objects.
|
|
57
|
+
"""
|
|
58
|
+
return self._Items
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def ContainsId(self, itemId:str=False) -> bool:
|
|
62
|
+
"""
|
|
63
|
+
Checks the `Items` collection to see if an item already exists with the
|
|
64
|
+
specified Id value.
|
|
65
|
+
|
|
66
|
+
Returns True if the itemId exists in the collection; otherwise, False.
|
|
67
|
+
"""
|
|
68
|
+
result:bool = False
|
|
69
|
+
|
|
70
|
+
item:AudiobookSimplified
|
|
71
|
+
for item in self._Items:
|
|
72
|
+
if item.Id == itemId:
|
|
73
|
+
result = True
|
|
74
|
+
break
|
|
75
|
+
|
|
76
|
+
return result
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def ToString(self, includeItems:bool=False) -> str:
|
|
80
|
+
"""
|
|
81
|
+
Returns a displayable string representation of the class.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
includeItems (bool):
|
|
85
|
+
True to include the Items collection of objects; otherwise, False
|
|
86
|
+
to only return base properties.
|
|
87
|
+
"""
|
|
88
|
+
return 'AudiobookPageSimplified: %s' % super().ToString(includeItems)
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
# external package imports.
|
|
2
|
+
|
|
3
|
+
# our package imports.
|
|
4
|
+
from ..sautils import export
|
|
5
|
+
from .author import Author
|
|
6
|
+
from .copyright import Copyright
|
|
7
|
+
from .externalurls import ExternalUrls
|
|
8
|
+
from .imageobject import ImageObject
|
|
9
|
+
from .narrator import Narrator
|
|
10
|
+
|
|
11
|
+
@export
|
|
12
|
+
class AudiobookSimplified:
|
|
13
|
+
"""
|
|
14
|
+
Spotify Web API Simplified Audiobook object.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
def __init__(self, root:dict=None) -> None:
|
|
18
|
+
"""
|
|
19
|
+
Initializes a new instance of the class.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
root (dict):
|
|
23
|
+
Spotify Web API JSON response in dictionary format, used to load object
|
|
24
|
+
attributes; otherwise, None to not load attributes.
|
|
25
|
+
"""
|
|
26
|
+
self._Authors:list[Author] = []
|
|
27
|
+
self._AvailableMarkets:list[str] = []
|
|
28
|
+
self._Copyrights:list[Copyright] = []
|
|
29
|
+
self._Description:str = None
|
|
30
|
+
self._Edition:str = None
|
|
31
|
+
self._Explicit:bool = None
|
|
32
|
+
self._ExternalUrls:ExternalUrls = None
|
|
33
|
+
self._Href:str = None
|
|
34
|
+
self._HtmlDescription:str = None
|
|
35
|
+
self._Id:str = None
|
|
36
|
+
self._Images:list[ImageObject] = []
|
|
37
|
+
self._Languages:list[str] = []
|
|
38
|
+
self._MediaType:str = None
|
|
39
|
+
self._Name:str = None
|
|
40
|
+
self._Narrators:list[Narrator] = []
|
|
41
|
+
self._Publisher:str = None
|
|
42
|
+
self._TotalChapters:int = None
|
|
43
|
+
self._Type:str = None
|
|
44
|
+
self._Uri:str = None
|
|
45
|
+
|
|
46
|
+
if (root is None):
|
|
47
|
+
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
else:
|
|
51
|
+
|
|
52
|
+
self._AvailableMarkets = root.get('available_markets', None) or []
|
|
53
|
+
self._Description = root.get('description', None)
|
|
54
|
+
self._Edition = root.get('edition', None)
|
|
55
|
+
self._Explicit = root.get('explicit', None)
|
|
56
|
+
self._Href = root.get('href', None)
|
|
57
|
+
self._HtmlDescription = root.get('html_description', None)
|
|
58
|
+
self._Id = root.get('id', None)
|
|
59
|
+
self._Languages = root.get('languages', None) or []
|
|
60
|
+
self._MediaType = root.get('media_type', None)
|
|
61
|
+
self._Name = root.get('name', None)
|
|
62
|
+
self._Publisher = root.get('publisher', None)
|
|
63
|
+
self._TotalChapters = root.get('total_chapters', None)
|
|
64
|
+
self._Type = root.get('type', None)
|
|
65
|
+
self._Uri = root.get('uri', None)
|
|
66
|
+
|
|
67
|
+
# process all collections and objects.
|
|
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))
|
|
72
|
+
|
|
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))
|
|
77
|
+
|
|
78
|
+
item:dict = root.get('external_urls',None)
|
|
79
|
+
if item is not None:
|
|
80
|
+
self._ExternalUrls = ExternalUrls(root=item)
|
|
81
|
+
|
|
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))
|
|
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))
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def __repr__(self) -> str:
|
|
94
|
+
return self.ToString()
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def __str__(self) -> str:
|
|
98
|
+
return self.ToString()
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
# implement sorting support.
|
|
102
|
+
def __eq__(self, other):
|
|
103
|
+
try:
|
|
104
|
+
return self.Name == other.Name
|
|
105
|
+
except Exception:
|
|
106
|
+
if (isinstance(self, AudiobookSimplified )) and (isinstance(other, AudiobookSimplified )):
|
|
107
|
+
return self.Name == other.Name
|
|
108
|
+
return False
|
|
109
|
+
|
|
110
|
+
def __lt__(self, other):
|
|
111
|
+
try:
|
|
112
|
+
return self.Name < other.Name
|
|
113
|
+
except Exception:
|
|
114
|
+
if (isinstance(self, AudiobookSimplified )) and (isinstance(other, AudiobookSimplified )):
|
|
115
|
+
return self.Name < other.Name
|
|
116
|
+
return False
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
@property
|
|
120
|
+
def Authors(self) -> list[Author]:
|
|
121
|
+
"""
|
|
122
|
+
The author(s) for the audiobook.
|
|
123
|
+
"""
|
|
124
|
+
return self._Authors
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
@property
|
|
128
|
+
def AvailableMarkets(self) -> list[str]:
|
|
129
|
+
"""
|
|
130
|
+
A list of the countries in which the audiobook can be played, identified by
|
|
131
|
+
their ISO 3166-1 alpha-2 code.
|
|
132
|
+
|
|
133
|
+
Example: `["CA","BR","IT"]`
|
|
134
|
+
"""
|
|
135
|
+
return self._AvailableMarkets
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
@property
|
|
139
|
+
def Copyrights(self) -> list[Copyright]:
|
|
140
|
+
"""
|
|
141
|
+
The copyright statements of the audiobook.
|
|
142
|
+
"""
|
|
143
|
+
return self._Copyrights
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
@property
|
|
147
|
+
def Description(self) -> str:
|
|
148
|
+
"""
|
|
149
|
+
A description of the audiobook.
|
|
150
|
+
|
|
151
|
+
HTML tags are stripped away from this field, use html_description field in case HTML tags are needed.
|
|
152
|
+
"""
|
|
153
|
+
return self._Description
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
@property
|
|
157
|
+
def Edition(self) -> str:
|
|
158
|
+
"""
|
|
159
|
+
The edition of the audiobook.
|
|
160
|
+
|
|
161
|
+
Example: `Unabridged`
|
|
162
|
+
"""
|
|
163
|
+
return self._Edition
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
@property
|
|
167
|
+
def Explicit(self) -> bool:
|
|
168
|
+
"""
|
|
169
|
+
Whether or not the audiobook has explicit content (true = yes it does; false = no it does not OR unknown).
|
|
170
|
+
"""
|
|
171
|
+
return self._Explicit
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
@property
|
|
175
|
+
def ExternalUrls(self) -> ExternalUrls:
|
|
176
|
+
"""
|
|
177
|
+
Known external URLs for the audiobook.
|
|
178
|
+
"""
|
|
179
|
+
return self._ExternalUrls
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
@property
|
|
183
|
+
def Href(self) -> str:
|
|
184
|
+
"""
|
|
185
|
+
A link to the Web API endpoint providing full details of the audiobook.
|
|
186
|
+
|
|
187
|
+
Example: `https://api.spotify.com/v1/audiobooks/7iHfbu1YPACw6oZPAFJtqe`
|
|
188
|
+
"""
|
|
189
|
+
return self._Href
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
@property
|
|
193
|
+
def HtmlDescription(self) -> str:
|
|
194
|
+
"""
|
|
195
|
+
A description of the audiobook. This field may contain HTML tags.
|
|
196
|
+
"""
|
|
197
|
+
return self._HtmlDescription
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
@property
|
|
201
|
+
def Id(self) -> str:
|
|
202
|
+
"""
|
|
203
|
+
The Spotify ID for the audiobook.
|
|
204
|
+
|
|
205
|
+
Example: `7iHfbu1YPACw6oZPAFJtqe`
|
|
206
|
+
"""
|
|
207
|
+
return self._Id
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
@property
|
|
211
|
+
def Images(self) -> list[ImageObject]:
|
|
212
|
+
"""
|
|
213
|
+
The cover art for the audiobook in various sizes, widest first.
|
|
214
|
+
"""
|
|
215
|
+
return self._Images
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
@property
|
|
219
|
+
def ImageUrl(self) -> str:
|
|
220
|
+
"""
|
|
221
|
+
Returns the highest resolution order image from the `Images` list, if images
|
|
222
|
+
are defined; otherwise, null.
|
|
223
|
+
"""
|
|
224
|
+
return ImageObject.GetImageHighestResolution(self._Images)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
@property
|
|
228
|
+
def Languages(self) -> list[str]:
|
|
229
|
+
"""
|
|
230
|
+
A list of the languages used in the audiobook, identified by their ISO 639-1 code.
|
|
231
|
+
|
|
232
|
+
Example: `[fr,en]`
|
|
233
|
+
"""
|
|
234
|
+
return self._Languages
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
@property
|
|
238
|
+
def MediaType(self) -> str:
|
|
239
|
+
"""
|
|
240
|
+
The media type of the audiobook.
|
|
241
|
+
|
|
242
|
+
Example: `audio`
|
|
243
|
+
"""
|
|
244
|
+
return self._MediaType
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
@property
|
|
248
|
+
def Name(self) -> str:
|
|
249
|
+
"""
|
|
250
|
+
The name of the audiobook.
|
|
251
|
+
"""
|
|
252
|
+
return self._Name
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
@property
|
|
256
|
+
def Narrators(self) -> list[Narrator]:
|
|
257
|
+
"""
|
|
258
|
+
The narrator(s) for the audiobook.
|
|
259
|
+
"""
|
|
260
|
+
return self._Narrators
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
@property
|
|
264
|
+
def Publisher(self) -> str:
|
|
265
|
+
"""
|
|
266
|
+
The publisher of the audiobook.
|
|
267
|
+
"""
|
|
268
|
+
return self._Publisher
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
@property
|
|
272
|
+
def TotalChapters(self) -> int:
|
|
273
|
+
"""
|
|
274
|
+
The number of chapters in the audiobook.
|
|
275
|
+
"""
|
|
276
|
+
return self._TotalChapters
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
@property
|
|
280
|
+
def Type(self) -> str:
|
|
281
|
+
"""
|
|
282
|
+
The object type: `audiobook`.
|
|
283
|
+
"""
|
|
284
|
+
return self._Type
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
@property
|
|
288
|
+
def Uri(self) -> str:
|
|
289
|
+
"""
|
|
290
|
+
The Spotify URI for the audiobook.
|
|
291
|
+
|
|
292
|
+
Example: `spotify:audiobook:7iHfbu1YPACw6oZPAFJtqe`
|
|
293
|
+
"""
|
|
294
|
+
return self._Uri
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
def ToDictionary(self) -> dict:
|
|
298
|
+
"""
|
|
299
|
+
Returns a dictionary representation of the class.
|
|
300
|
+
"""
|
|
301
|
+
externalUrls:dict = {}
|
|
302
|
+
if self._ExternalUrls is not None:
|
|
303
|
+
externalUrls = self._ExternalUrls.ToDictionary()
|
|
304
|
+
|
|
305
|
+
result:dict = \
|
|
306
|
+
{
|
|
307
|
+
'authors': [ item.ToDictionary() for item in self._Authors ],
|
|
308
|
+
'available_markets': [ item for item in self._AvailableMarkets ],
|
|
309
|
+
'copyrights': [ item.ToDictionary() for item in self._Copyrights ],
|
|
310
|
+
'description': self._Description,
|
|
311
|
+
'edition': self._Edition,
|
|
312
|
+
'explicit': self._Explicit,
|
|
313
|
+
'external_urls': externalUrls,
|
|
314
|
+
'href': self._Href,
|
|
315
|
+
'html_description': self._HtmlDescription,
|
|
316
|
+
'id': self._Id,
|
|
317
|
+
'image_url': self.ImageUrl,
|
|
318
|
+
'images': [ item.ToDictionary() for item in self._Images ],
|
|
319
|
+
'languages': [ item for item in self._Languages ],
|
|
320
|
+
'media_type': self._MediaType,
|
|
321
|
+
'name': self._Name,
|
|
322
|
+
'narrators': [ item.ToDictionary() for item in self._Narrators ],
|
|
323
|
+
'publisher': self._Publisher,
|
|
324
|
+
'total_chapters': self._TotalChapters,
|
|
325
|
+
'type': self._Type,
|
|
326
|
+
'uri': self._Uri,
|
|
327
|
+
}
|
|
328
|
+
return result
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
def ToString(self, includeTitle:bool=True) -> str:
|
|
332
|
+
"""
|
|
333
|
+
Returns a displayable string representation of the class.
|
|
334
|
+
|
|
335
|
+
Args:
|
|
336
|
+
includeTitle (str):
|
|
337
|
+
True to include the class name title prefix.
|
|
338
|
+
"""
|
|
339
|
+
msg:str = ''
|
|
340
|
+
if includeTitle:
|
|
341
|
+
msg = 'AudiobookSimplified:'
|
|
342
|
+
|
|
343
|
+
if self._Name is not None: msg = '%s\n Name="%s"' % (msg, str(self._Name))
|
|
344
|
+
if self._Uri is not None: msg = '%s\n Uri="%s"' % (msg, str(self._Uri))
|
|
345
|
+
if self._Authors is not None: msg = '%s\n Authors Count=%s' % (msg, str(len(self._Authors)))
|
|
346
|
+
if self._AvailableMarkets is not None: msg = '%s\n AvailableMarkets Count=%s' % (msg, str(len(self._AvailableMarkets)))
|
|
347
|
+
#if self._Copyrights is not None: msg = '%s\n %s' % (msg, str(self._Copyrights))
|
|
348
|
+
if self._Description is not None: msg = '%s\n Description="%s"' % (msg, str(self._Description))
|
|
349
|
+
if self._Edition is not None: msg = '%s\n Edition="%s"' % (msg, str(self._Edition))
|
|
350
|
+
if self._Explicit is not None: msg = '%s\n Explicit="%s"' % (msg, str(self._Explicit))
|
|
351
|
+
#if self._ExternalUrls is not None: msg = '%s\n %s' % (msg, str(self._ExternalUrls))
|
|
352
|
+
if self._Href is not None: msg = '%s\n Href="%s"' % (msg, str(self._Href))
|
|
353
|
+
if self._HtmlDescription is not None: msg = '%s\n HtmlDescription="%s"' % (msg, str(self._HtmlDescription))
|
|
354
|
+
if self._Id is not None: msg = '%s\n Id="%s"' % (msg, str(self._Id))
|
|
355
|
+
if self._Images is not None: msg = '%s\n Images Count=%s' % (msg, str(len(self._Images)))
|
|
356
|
+
if self._Languages is not None: msg = '%s\n Languages Count=%s' % (msg, str(len(self._Languages)))
|
|
357
|
+
if self._MediaType is not None: msg = '%s\n MediaType="%s"' % (msg, str(self._MediaType))
|
|
358
|
+
if self._Narrators is not None: msg = '%s\n Narrators Count=%s' % (msg, str(len(self._Narrators)))
|
|
359
|
+
if self._Publisher is not None: msg = '%s\n Publisher="%s"' % (msg, str(self._Publisher))
|
|
360
|
+
if self._TotalChapters is not None: msg = '%s\n TotalChapters="%s"' % (msg, str(self._TotalChapters))
|
|
361
|
+
if self._Type is not None: msg = '%s\n Type="%s"' % (msg, str(self._Type))
|
|
362
|
+
return msg
|