spotifywebapiPython 1.0.35__py3-none-any.whl → 1.0.147__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.35.dist-info → spotifywebapiPython-1.0.147.dist-info}/LICENSE +1 -1
- {spotifywebapiPython-1.0.35.dist-info → spotifywebapiPython-1.0.147.dist-info}/METADATA +7 -6
- spotifywebapiPython-1.0.147.dist-info/RECORD +117 -0
- spotifywebapipython/__init__.py +2 -0
- spotifywebapipython/const.py +19 -1
- spotifywebapipython/docs/__init__.html +799 -3
- spotifywebapipython/docs/index.html +21 -3
- spotifywebapipython/docs/search.js +1 -1
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/const.html +72 -4
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/saappmessages.html +77 -3
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/sautils.html +63 -3
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyapierror.html +3 -3
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyapimessage.html +20 -3
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyauthtoken.html +39 -3
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyclient.html +2553 -364
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifydiscovery.html +85 -52
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifywebapiauthenticationerror.html +3 -3
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifywebapierror.html +3 -3
- spotifywebapipython/models/__init__.py +8 -0
- spotifywebapipython/models/albumpagesaved.py +2 -1
- spotifywebapipython/models/albumpagesimplified.py +2 -1
- spotifywebapipython/models/albumsimplified.py +4 -5
- spotifywebapipython/models/artist.py +4 -5
- spotifywebapipython/models/artistinfo.py +282 -0
- spotifywebapipython/models/artistinfotourevent.py +127 -0
- spotifywebapipython/models/artistpage.py +2 -1
- spotifywebapipython/models/artistsimplified.py +4 -0
- spotifywebapipython/models/audiobookpagesimplified.py +2 -1
- spotifywebapipython/models/audiobooksimplified.py +4 -5
- spotifywebapipython/models/category.py +16 -0
- spotifywebapipython/models/categorypage.py +2 -1
- spotifywebapipython/models/chapterpagesimplified.py +2 -1
- spotifywebapipython/models/chaptersimplified.py +6 -7
- spotifywebapipython/models/context.py +1 -3
- spotifywebapipython/models/device.py +85 -2
- spotifywebapipython/models/episodepagesaved.py +2 -1
- spotifywebapipython/models/episodepagesimplified.py +2 -1
- spotifywebapipython/models/episodesaved.py +2 -2
- spotifywebapipython/models/episodesimplified.py +5 -6
- spotifywebapipython/models/imageobject.py +98 -0
- spotifywebapipython/models/pageobject.py +29 -4
- spotifywebapipython/models/playeractions.py +33 -11
- spotifywebapipython/models/playerplaystate.py +128 -13
- spotifywebapipython/models/playerqueueinfo.py +61 -4
- spotifywebapipython/models/playhistorypage.py +2 -1
- spotifywebapipython/models/playlist.py +6 -3
- spotifywebapipython/models/playlistpage.py +2 -1
- spotifywebapipython/models/playlistpagesimplified.py +2 -1
- spotifywebapipython/models/playlistsimplified.py +49 -7
- spotifywebapipython/models/playlisttrack.py +1 -0
- spotifywebapipython/models/playlisttracksummary.py +3 -1
- spotifywebapipython/models/searchresponse.py +1 -1
- spotifywebapipython/models/showpagesaved.py +2 -1
- spotifywebapipython/models/showpagesimplified.py +2 -1
- spotifywebapipython/models/showsaved.py +2 -2
- spotifywebapipython/models/showsimplified.py +8 -5
- spotifywebapipython/models/spotifyconnectdevice.py +188 -0
- spotifywebapipython/models/spotifyconnectdevices.py +628 -0
- spotifywebapipython/models/track.py +2 -1
- spotifywebapipython/models/trackpage.py +42 -1
- spotifywebapipython/models/trackpagesaved.py +2 -1
- spotifywebapipython/models/trackpagesimplified.py +2 -1
- spotifywebapipython/models/trackrecommendations.py +5 -5
- spotifywebapipython/models/tracksimplified.py +10 -3
- spotifywebapipython/models/userprofile.py +25 -1
- spotifywebapipython/models/userprofilesimplified.py +4 -5
- spotifywebapipython/models/zeroconfdiscoveryresult.py +599 -0
- spotifywebapipython/models/zeroconfproperty.py +93 -0
- spotifywebapipython/oauthcli/authclient.py +119 -19
- spotifywebapipython/saappmessages.py +21 -1
- spotifywebapipython/sautils.py +88 -1
- spotifywebapipython/spotifyapimessage.py +18 -1
- spotifywebapipython/spotifyauthtoken.py +26 -0
- spotifywebapipython/spotifyclient.py +4311 -525
- spotifywebapipython/spotifyconnectdeviceeventargs.py +67 -0
- spotifywebapipython/spotifydiscovery.py +326 -136
- 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 +1315 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfo.py +619 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfoalias.py +105 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfodrmmediaformat.py +90 -0
- spotifywebapipython/zeroconfapi/zeroconfresponse.py +141 -0
- spotifywebapiPython-1.0.35.dist-info/RECORD +0 -98
- {spotifywebapiPython-1.0.35.dist-info → spotifywebapiPython-1.0.147.dist-info}/WHEEL +0 -0
- {spotifywebapiPython-1.0.35.dist-info → spotifywebapiPython-1.0.147.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# external package imports.
|
|
2
|
+
|
|
3
|
+
# our package imports.
|
|
4
|
+
from ..sautils import export
|
|
5
|
+
from .zeroconfdiscoveryresult import ZeroconfDiscoveryResult
|
|
6
|
+
from spotifywebapipython.zeroconfapi.zeroconfgetinfo import ZeroconfGetInfo
|
|
7
|
+
|
|
8
|
+
@export
|
|
9
|
+
class SpotifyConnectDevice():
|
|
10
|
+
"""
|
|
11
|
+
Spotify Connect Device object.
|
|
12
|
+
|
|
13
|
+
Information about the Spotify Connect device, which is a combination of the
|
|
14
|
+
`ZeroconfDiscoveryResult` and `ZeroconfGetInfo` classes.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
def __init__(self) -> None:
|
|
18
|
+
"""
|
|
19
|
+
Initializes a new instance of the class.
|
|
20
|
+
"""
|
|
21
|
+
self._DiscoveryResult:ZeroconfDiscoveryResult = None
|
|
22
|
+
self._DeviceInfo:ZeroconfGetInfo = None
|
|
23
|
+
self._Id:str = None
|
|
24
|
+
self._Name:str = None
|
|
25
|
+
self._WasReConnected:bool = False
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def __repr__(self) -> str:
|
|
29
|
+
return self.ToString()
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def __str__(self) -> str:
|
|
33
|
+
return self.ToString()
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def DiscoveryResult(self) -> ZeroconfDiscoveryResult:
|
|
38
|
+
"""
|
|
39
|
+
Information about the Zeroconf entry for a SpotifyConnect device as found by Zeroconf (mDNS).
|
|
40
|
+
"""
|
|
41
|
+
return self._DiscoveryResult
|
|
42
|
+
|
|
43
|
+
@DiscoveryResult.setter
|
|
44
|
+
def DiscoveryResult(self, value:ZeroconfDiscoveryResult):
|
|
45
|
+
"""
|
|
46
|
+
Sets the DiscoveryResult property value.
|
|
47
|
+
"""
|
|
48
|
+
if isinstance(value, ZeroconfDiscoveryResult):
|
|
49
|
+
self._DiscoveryResult = value
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def DeviceInfo(self) -> ZeroconfGetInfo:
|
|
54
|
+
"""
|
|
55
|
+
Spotify Zeroconf API GetInfo response object.
|
|
56
|
+
"""
|
|
57
|
+
return self._DeviceInfo
|
|
58
|
+
|
|
59
|
+
@DeviceInfo.setter
|
|
60
|
+
def DeviceInfo(self, value:ZeroconfGetInfo):
|
|
61
|
+
"""
|
|
62
|
+
Sets the DeviceInfo property value.
|
|
63
|
+
"""
|
|
64
|
+
if isinstance(value, ZeroconfGetInfo):
|
|
65
|
+
self._DeviceInfo = value
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def Id(self) -> str:
|
|
70
|
+
"""
|
|
71
|
+
Spotify Connect device id value (e.g. "30fbc80e35598f3c242f2120413c943dfd9715fe").
|
|
72
|
+
"""
|
|
73
|
+
return self._Id
|
|
74
|
+
|
|
75
|
+
@Id.setter
|
|
76
|
+
def Id(self, value:str):
|
|
77
|
+
"""
|
|
78
|
+
Sets the Id property value.
|
|
79
|
+
"""
|
|
80
|
+
self._Id = value
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def IsChromeCast(self) -> bool:
|
|
85
|
+
"""
|
|
86
|
+
True if the device is a Google ChromeCast device; otherwise, False.
|
|
87
|
+
"""
|
|
88
|
+
if (self._DiscoveryResult is not None):
|
|
89
|
+
return self._DiscoveryResult.IsChromeCast
|
|
90
|
+
return False
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
@property
|
|
94
|
+
def Name(self) -> str:
|
|
95
|
+
"""
|
|
96
|
+
Spotify Connect device name value (e.g. "Bose-ST10-1").
|
|
97
|
+
"""
|
|
98
|
+
return self._Name
|
|
99
|
+
|
|
100
|
+
@Name.setter
|
|
101
|
+
def Name(self, value:str):
|
|
102
|
+
"""
|
|
103
|
+
Sets the Name property value.
|
|
104
|
+
"""
|
|
105
|
+
self._Name = value
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
@property
|
|
109
|
+
def Title(self) -> str:
|
|
110
|
+
"""
|
|
111
|
+
Spotify Connect device name and id value (e.g. '"Bose-ST10-1" (30fbc80e35598f3c242f2120413c943dfd9715fe)').
|
|
112
|
+
"""
|
|
113
|
+
return '%s (%s)' % (self._Name, self._Id)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
@property
|
|
117
|
+
def WasReConnected(self) -> bool:
|
|
118
|
+
"""
|
|
119
|
+
True if the device was re-connected, after being inactive or disconnected.
|
|
120
|
+
"""
|
|
121
|
+
return self._WasReConnected
|
|
122
|
+
|
|
123
|
+
@WasReConnected.setter
|
|
124
|
+
def WasReConnected(self, value:bool):
|
|
125
|
+
"""
|
|
126
|
+
Sets the WasReConnected property value.
|
|
127
|
+
"""
|
|
128
|
+
self._WasReConnected = value
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def Equals(self, obj) -> bool:
|
|
132
|
+
"""
|
|
133
|
+
Returns true if the specified object instance contains the same argument
|
|
134
|
+
values as our object instance values; otherwise, False.
|
|
135
|
+
|
|
136
|
+
Args:
|
|
137
|
+
obj (SpotifyConnectDevice):
|
|
138
|
+
Object instance to compare.
|
|
139
|
+
"""
|
|
140
|
+
result:bool = False
|
|
141
|
+
if (not isinstance(obj, type(self))):
|
|
142
|
+
return result
|
|
143
|
+
|
|
144
|
+
# compare attributes for equality.
|
|
145
|
+
if (self._Id != obj._Id): return result
|
|
146
|
+
if (self._Name != obj._Name): return result
|
|
147
|
+
if (not self._DeviceInfo.Equals(obj._DeviceInfo)): return result
|
|
148
|
+
if (not self._DiscoveryResult.Equals(obj._DiscoveryResult)): return result
|
|
149
|
+
|
|
150
|
+
# objects attributes are equal.
|
|
151
|
+
return True
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def ToDictionary(self) -> dict:
|
|
155
|
+
"""
|
|
156
|
+
Returns a dictionary representation of the class.
|
|
157
|
+
"""
|
|
158
|
+
result:dict = \
|
|
159
|
+
{
|
|
160
|
+
'Id': self._Id,
|
|
161
|
+
'Name': self._Name,
|
|
162
|
+
'Title': self.Title,
|
|
163
|
+
'WasReConnected': self._WasReConnected,
|
|
164
|
+
'IsChromeCast': self.IsChromeCast,
|
|
165
|
+
'DeviceInfo': self._DeviceInfo.ToDictionary(),
|
|
166
|
+
'DiscoveryResult': self._DiscoveryResult.ToDictionary(),
|
|
167
|
+
}
|
|
168
|
+
return result
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def ToString(self, includeTitle:bool=True) -> str:
|
|
172
|
+
"""
|
|
173
|
+
Returns a displayable string representation of the class.
|
|
174
|
+
|
|
175
|
+
Args:
|
|
176
|
+
includeTitle (str):
|
|
177
|
+
True to include the class name title prefix.
|
|
178
|
+
"""
|
|
179
|
+
msg:str = ''
|
|
180
|
+
if includeTitle:
|
|
181
|
+
msg = 'Device: "%s" (%s)' % (self._Name, self._Id)
|
|
182
|
+
msg = '%s\n WasReConnected="%s"' % (msg, str(self._WasReConnected))
|
|
183
|
+
msg = '%s\n' % (msg)
|
|
184
|
+
|
|
185
|
+
# build result.
|
|
186
|
+
msg = '%s\n %s\n' % (msg, str(self._DeviceInfo.ToString(True)))
|
|
187
|
+
msg = '%s\n %s\n' % (msg, str(self._DiscoveryResult.ToString(True)))
|
|
188
|
+
return msg
|