spotifywebapiPython 1.0.43__py3-none-any.whl → 1.0.45__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.43.dist-info → spotifywebapiPython-1.0.45.dist-info}/METADATA +1 -1
- {spotifywebapiPython-1.0.43.dist-info → spotifywebapiPython-1.0.45.dist-info}/RECORD +33 -26
- spotifywebapipython/const.py +1 -1
- spotifywebapipython/docs/__init__.html +23 -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 +200 -2
- spotifywebapipython/docs/spotifywebapiPython/spotifydiscovery.html +45 -2
- spotifywebapipython/docs/spotifywebapiPython/spotifywebapiauthenticationerror.html +2 -2
- spotifywebapipython/docs/spotifywebapiPython/spotifywebapierror.html +2 -2
- spotifywebapipython/models/__init__.py +14 -0
- spotifywebapipython/models/playlist.py +4 -1
- spotifywebapipython/models/playlistsimplified.py +4 -1
- spotifywebapipython/models/playlisttracksummary.py +3 -1
- spotifywebapipython/models/searchresponse.py +1 -1
- spotifywebapipython/models/zeroconfblobbuilder.py +144 -0
- spotifywebapipython/models/zeroconfdiscoveryresult.py +451 -0
- spotifywebapipython/models/zeroconfgetinfo.py +359 -0
- spotifywebapipython/models/zeroconfgetinfoalias.py +96 -0
- spotifywebapipython/models/zeroconfgetinfodrmmediaformat.py +90 -0
- spotifywebapipython/models/zeroconfproperty.py +93 -0
- spotifywebapipython/models/zeroconfresponse.py +108 -0
- spotifywebapipython/spotifyclient.py +293 -3
- spotifywebapipython/spotifydiscovery.py +98 -11
- {spotifywebapiPython-1.0.43.dist-info → spotifywebapiPython-1.0.45.dist-info}/LICENSE +0 -0
- {spotifywebapiPython-1.0.43.dist-info → spotifywebapiPython-1.0.45.dist-info}/WHEEL +0 -0
- {spotifywebapiPython-1.0.43.dist-info → spotifywebapiPython-1.0.45.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
# external package imports.
|
|
2
|
+
|
|
3
|
+
# our package imports.
|
|
4
|
+
from ..sautils import export
|
|
5
|
+
from .zeroconfgetinfoalias import ZeroconfGetInfoAlias
|
|
6
|
+
from .zeroconfgetinfodrmmediaformat import ZeroconfGetInfoDrmMediaFormat
|
|
7
|
+
from .zeroconfresponse import ZeroconfResponse
|
|
8
|
+
|
|
9
|
+
@export
|
|
10
|
+
class ZeroconfGetInfo(ZeroconfResponse):
|
|
11
|
+
"""
|
|
12
|
+
Spotify Web API Zeroconf GetInfo response object.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, root:dict=None) -> None:
|
|
16
|
+
"""
|
|
17
|
+
Initializes a new instance of the class.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
root (dict):
|
|
21
|
+
Spotify Web API JSON response in dictionary format, used to load object
|
|
22
|
+
attributes; otherwise, None to not load attributes.
|
|
23
|
+
"""
|
|
24
|
+
# initialize base class.
|
|
25
|
+
super().__init__(root=root)
|
|
26
|
+
|
|
27
|
+
# initialize our attributes.
|
|
28
|
+
self._AccountReq:str = None
|
|
29
|
+
self._ActiveUser:str = None
|
|
30
|
+
self._Aliases:list[ZeroconfGetInfoAlias] = []
|
|
31
|
+
self._Availability:str = None
|
|
32
|
+
self._BrandDisplayName:str = None
|
|
33
|
+
self._ClientId:str = None
|
|
34
|
+
self._DeviceId:str = None
|
|
35
|
+
self._DeviceType:str = None
|
|
36
|
+
self._GroupStatus:str = None
|
|
37
|
+
self._LibraryVersion:str = None
|
|
38
|
+
self._ModelDisplayName:str = None
|
|
39
|
+
self._ProductId:str = None
|
|
40
|
+
self._PublicKey:str = None
|
|
41
|
+
self._RemoteName:str = None
|
|
42
|
+
self._ResolverVersion:str = None
|
|
43
|
+
self._Scope:str = None
|
|
44
|
+
self._SupportedCapabilities:int = None
|
|
45
|
+
self._SupportedDrmMediaFormats:list[ZeroconfGetInfoDrmMediaFormat] = []
|
|
46
|
+
self._TokenType:str = None
|
|
47
|
+
self._Version:str = None
|
|
48
|
+
self._VoiceSupport:str = None
|
|
49
|
+
|
|
50
|
+
if (root is None):
|
|
51
|
+
|
|
52
|
+
pass
|
|
53
|
+
|
|
54
|
+
else:
|
|
55
|
+
|
|
56
|
+
self._AccountReq = root.get('accountReq', None)
|
|
57
|
+
self._ActiveUser = root.get('activeUser', None)
|
|
58
|
+
self._Availability = root.get('availability', None)
|
|
59
|
+
self._BrandDisplayName = root.get('brandDisplayName', None)
|
|
60
|
+
self._ClientId = root.get('clientID', None)
|
|
61
|
+
self._DeviceId = root.get('deviceID', None)
|
|
62
|
+
self._DeviceType = root.get('deviceType', None)
|
|
63
|
+
self._GroupStatus = root.get('groupStatus', None)
|
|
64
|
+
self._LibraryVersion = root.get('libraryVersion', None)
|
|
65
|
+
self._ModelDisplayName = root.get('modelDisplayName', None)
|
|
66
|
+
self._ProductId = root.get('productID', None)
|
|
67
|
+
self._PublicKey = root.get('publicKey', None)
|
|
68
|
+
self._RemoteName = root.get('remoteName', None)
|
|
69
|
+
self._ResolverVersion = root.get('resolverVersion', None)
|
|
70
|
+
self._Scope = root.get('scope', None)
|
|
71
|
+
self._SupportedCapabilities = root.get('supported_capabilities', None)
|
|
72
|
+
self._TokenType = root.get('tokenType', None)
|
|
73
|
+
self._Version = root.get('version', None)
|
|
74
|
+
self._VoiceSupport = root.get('voiceSupport', None)
|
|
75
|
+
|
|
76
|
+
# process all collections and objects.
|
|
77
|
+
items:list = root.get('aliases',None)
|
|
78
|
+
if items is not None:
|
|
79
|
+
for item in items:
|
|
80
|
+
self._Aliases.append(ZeroconfGetInfoAlias(root=item))
|
|
81
|
+
|
|
82
|
+
items:list = root.get('supported_drm_media_formats',None)
|
|
83
|
+
if items is not None:
|
|
84
|
+
for item in items:
|
|
85
|
+
self._SupportedDrmMediaFormats.append(ZeroconfGetInfoDrmMediaFormat(root=item))
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def __repr__(self) -> str:
|
|
89
|
+
return self.ToString()
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def __str__(self) -> str:
|
|
93
|
+
return self.ToString()
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
@property
|
|
97
|
+
def AccountReq(self) -> str:
|
|
98
|
+
"""
|
|
99
|
+
? TODO
|
|
100
|
+
"""
|
|
101
|
+
return self._AccountReq
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
@property
|
|
105
|
+
def ActiveUser(self) -> str:
|
|
106
|
+
"""
|
|
107
|
+
Canonical username of the logged in user (e.g. "31l77y2123456789012345678901").
|
|
108
|
+
|
|
109
|
+
This value will be blank if there is no user logged into the device.
|
|
110
|
+
"""
|
|
111
|
+
return self._ActiveUser
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
@property
|
|
115
|
+
def Aliases(self) -> list:
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
"""
|
|
119
|
+
return self._Aliases
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
@property
|
|
123
|
+
def Availability(self) -> str:
|
|
124
|
+
"""
|
|
125
|
+
? TODO
|
|
126
|
+
"""
|
|
127
|
+
return self._Availability
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
@property
|
|
131
|
+
def BrandDisplayName(self) -> str:
|
|
132
|
+
"""
|
|
133
|
+
A UTF-8-encoded brand name of the hardware device, for hardware integrations (e.g. "Bose", "Onkyo", etc).
|
|
134
|
+
"""
|
|
135
|
+
return self._BrandDisplayName
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
@property
|
|
139
|
+
def ClientId(self) -> str:
|
|
140
|
+
"""
|
|
141
|
+
Client id of the application (e.g. "79ebcb219e8e4e123456789000123456").
|
|
142
|
+
"""
|
|
143
|
+
return self._ClientId
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
@property
|
|
147
|
+
def DeviceId(self) -> str:
|
|
148
|
+
"""
|
|
149
|
+
Unique device ID used for ZeroConf logins (e.g. "30fbc80e35598f3c242f2120413c943dfd9715fe").
|
|
150
|
+
"""
|
|
151
|
+
return self._DeviceId
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
@property
|
|
155
|
+
def DeviceType(self) -> str:
|
|
156
|
+
"""
|
|
157
|
+
Type of the device (e.g. "SPEAKER", "AVR", etc).
|
|
158
|
+
|
|
159
|
+
Can be any of the following `SpDeviceType` devices:
|
|
160
|
+
- kSpDeviceTypeComputer Laptop or desktop computer device.
|
|
161
|
+
- kSpDeviceTypeTablet Tablet PC device.
|
|
162
|
+
- kSpDeviceTypeSmartphone Smartphone device.
|
|
163
|
+
- kSpDeviceTypeSpeaker Speaker device.
|
|
164
|
+
- kSpDeviceTypeTV Television device.
|
|
165
|
+
- kSpDeviceTypeAVR Audio/Video receiver device.
|
|
166
|
+
- kSpDeviceTypeSTB Set-Top Box device.
|
|
167
|
+
- kSpDeviceTypeAudioDongle Audio dongle device.
|
|
168
|
+
- kSpDeviceTypeGameConsole Game console device.
|
|
169
|
+
- kSpDeviceTypeCastVideo Chromecast Video.
|
|
170
|
+
- kSpDeviceTypeCastAudio Chromecast Audio.
|
|
171
|
+
- kSpDeviceTypeAutomobile Automobile.
|
|
172
|
+
- kSpDeviceTypeSmartwatch Smartwatch.
|
|
173
|
+
- kSpDeviceTypeChromebook Chromebook.
|
|
174
|
+
"""
|
|
175
|
+
return self._DeviceType
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
@property
|
|
179
|
+
def GroupStatus(self) -> str:
|
|
180
|
+
"""
|
|
181
|
+
? TODO ... (e.g. "NONE").
|
|
182
|
+
"""
|
|
183
|
+
return self._GroupStatus
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
@property
|
|
187
|
+
def LibraryVersion(self) -> str:
|
|
188
|
+
"""
|
|
189
|
+
Client library version that processed the Zeroconf action (e.g. "3.88.29-gc4d4bb01").
|
|
190
|
+
"""
|
|
191
|
+
return self._LibraryVersion
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
@property
|
|
195
|
+
def ModelDisplayName(self) -> str:
|
|
196
|
+
"""
|
|
197
|
+
A UTF-8-encoded model name of the hardware device, for hardware integrations (e.g. "Soundtouch").
|
|
198
|
+
"""
|
|
199
|
+
return self._ModelDisplayName
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
@property
|
|
203
|
+
def ProductId(self) -> str:
|
|
204
|
+
"""
|
|
205
|
+
An integer enumerating the product for this partner (e.g. 12345).
|
|
206
|
+
"""
|
|
207
|
+
return self._ProductId
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
@property
|
|
211
|
+
def PublicKey(self) -> str:
|
|
212
|
+
"""
|
|
213
|
+
Public key used in ZeroConf logins (e.g. "G+ZM4irhc...").
|
|
214
|
+
"""
|
|
215
|
+
return self._PublicKey
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
@property
|
|
219
|
+
def RemoteName(self) -> str:
|
|
220
|
+
"""
|
|
221
|
+
Name to be displayed for the device (e.g. "BOSE-ST10-1").
|
|
222
|
+
"""
|
|
223
|
+
return self._RemoteName
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
@property
|
|
227
|
+
def ResolverVersion(self) -> str:
|
|
228
|
+
"""
|
|
229
|
+
? TODO ... (e.g. "0").
|
|
230
|
+
"""
|
|
231
|
+
return self._ResolverVersion
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
@property
|
|
235
|
+
def Scope(self) -> str:
|
|
236
|
+
"""
|
|
237
|
+
OAuth scope requested when authenticating with the Spotify backend (e.g. "streaming").
|
|
238
|
+
"""
|
|
239
|
+
return self._Scope
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
@property
|
|
243
|
+
def SupportedCapabilities(self) -> int:
|
|
244
|
+
"""
|
|
245
|
+
? TODO
|
|
246
|
+
"""
|
|
247
|
+
return self._SupportedCapabilities
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
@property
|
|
251
|
+
def SupportedDrmMediaFormats(self) -> list:
|
|
252
|
+
"""
|
|
253
|
+
? TODO
|
|
254
|
+
"""
|
|
255
|
+
return self._SupportedDrmMediaFormats
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
@property
|
|
259
|
+
def TokenType(self) -> str:
|
|
260
|
+
"""
|
|
261
|
+
Token type provided by the client (e.g. "accesstoken").
|
|
262
|
+
"""
|
|
263
|
+
return self._TokenType
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
@property
|
|
267
|
+
def Version(self) -> str:
|
|
268
|
+
"""
|
|
269
|
+
ZeroConf API version number (e.g. "2.10.0").
|
|
270
|
+
"""
|
|
271
|
+
return self._Version
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
@property
|
|
275
|
+
def VoiceSupport(self) -> str:
|
|
276
|
+
"""
|
|
277
|
+
Indicates if the device supports voice commands (e.g. "YES").
|
|
278
|
+
"""
|
|
279
|
+
return self._VoiceSupport
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
def ToDictionary(self) -> dict:
|
|
283
|
+
"""
|
|
284
|
+
Returns a dictionary representation of the class.
|
|
285
|
+
"""
|
|
286
|
+
# get base class result.
|
|
287
|
+
resultBase:dict = super().ToDictionary()
|
|
288
|
+
|
|
289
|
+
# get our attribute results.
|
|
290
|
+
result:dict = \
|
|
291
|
+
{
|
|
292
|
+
'AccountReq': self._AccountReq,
|
|
293
|
+
'ActiveUser': self._ActiveUser,
|
|
294
|
+
'Aliases': [ item.ToDictionary() for item in self._Aliases ],
|
|
295
|
+
'Availability': self._Availability,
|
|
296
|
+
'BrandDisplayName': self._BrandDisplayName,
|
|
297
|
+
'ClientId': self._ClientId,
|
|
298
|
+
'DeviceId': self._DeviceId,
|
|
299
|
+
'DeviceType': self._DeviceType,
|
|
300
|
+
'GroupStatus': self._GroupStatus,
|
|
301
|
+
'LibraryVersion': self._LibraryVersion,
|
|
302
|
+
'ModelDisplayName': self._ModelDisplayName,
|
|
303
|
+
'ProductId': self._ProductId,
|
|
304
|
+
'PublicKey': self._PublicKey,
|
|
305
|
+
'RemoteName': self._RemoteName,
|
|
306
|
+
'ResolverVersion': self._ResolverVersion,
|
|
307
|
+
'Scope': self._Scope,
|
|
308
|
+
'SupportedCapabilities': self._SupportedCapabilities,
|
|
309
|
+
'SupportedDrmMediaFormats': [ item.ToDictionary() for item in self._SupportedDrmMediaFormats ],
|
|
310
|
+
'TokenType': self._TokenType,
|
|
311
|
+
'Version': self._Version,
|
|
312
|
+
'VoiceSupport': self._VoiceSupport,
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
# combine base class results with these results.
|
|
316
|
+
resultBase.update(result)
|
|
317
|
+
|
|
318
|
+
# return an unsorted dictionary.
|
|
319
|
+
return resultBase
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
def ToString(self, includeTitle:bool=True) -> str:
|
|
323
|
+
"""
|
|
324
|
+
Returns a displayable string representation of the class.
|
|
325
|
+
|
|
326
|
+
Args:
|
|
327
|
+
includeTitle (str):
|
|
328
|
+
True to include the class name title prefix.
|
|
329
|
+
"""
|
|
330
|
+
msg:str = ''
|
|
331
|
+
if includeTitle:
|
|
332
|
+
msg = 'ZeroconfGetInfo: '
|
|
333
|
+
|
|
334
|
+
# get base class result.
|
|
335
|
+
msg = '%s%s' % (msg, super().ToString(False))
|
|
336
|
+
|
|
337
|
+
# get our attribute results.
|
|
338
|
+
if self._AccountReq is not None: msg = '%s\n AccountReq="%s"' % (msg, str(self._AccountReq))
|
|
339
|
+
if self._ActiveUser is not None: msg = '%s\n ActiveUser="%s"' % (msg, str(self._ActiveUser))
|
|
340
|
+
if self._Aliases is not None: msg = '%s\n Aliases=%s' % (msg, str(self._Aliases))
|
|
341
|
+
if self._Availability is not None: msg = '%s\n Availability="%s"' % (msg, str(self._Availability))
|
|
342
|
+
if self._BrandDisplayName is not None: msg = '%s\n BrandDisplayName="%s"' % (msg, str(self._BrandDisplayName))
|
|
343
|
+
if self._ClientId is not None: msg = '%s\n ClientId="%s"' % (msg, str(self._ClientId))
|
|
344
|
+
if self._DeviceId is not None: msg = '%s\n DeviceId="%s"' % (msg, str(self._DeviceId))
|
|
345
|
+
if self._DeviceType is not None: msg = '%s\n DeviceType="%s"' % (msg, str(self._DeviceType))
|
|
346
|
+
if self._GroupStatus is not None: msg = '%s\n GroupStatus="%s"' % (msg, str(self._GroupStatus))
|
|
347
|
+
if self._LibraryVersion is not None: msg = '%s\n LibraryVersion="%s"' % (msg, str(self._LibraryVersion))
|
|
348
|
+
if self._ModelDisplayName is not None: msg = '%s\n ModelDisplayName="%s"' % (msg, str(self._ModelDisplayName))
|
|
349
|
+
if self._ProductId is not None: msg = '%s\n ProductId="%s"' % (msg, str(self._ProductId))
|
|
350
|
+
if self._PublicKey is not None: msg = '%s\n PublicKey="%s"' % (msg, str(self._PublicKey))
|
|
351
|
+
if self._RemoteName is not None: msg = '%s\n RemoteName="%s"' % (msg, str(self._RemoteName))
|
|
352
|
+
if self._ResolverVersion is not None: msg = '%s\n ResolverVersion="%s"' % (msg, str(self._ResolverVersion))
|
|
353
|
+
if self._Scope is not None: msg = '%s\n Scope="%s"' % (msg, str(self._Scope))
|
|
354
|
+
if self._SupportedCapabilities is not None: msg = '%s\n SupportedCapabilities="%s"' % (msg, str(self._SupportedCapabilities))
|
|
355
|
+
if self._SupportedDrmMediaFormats is not None: msg = '%s\n SupportedDrmMediaFormats=%s' % (msg, str(self._SupportedDrmMediaFormats))
|
|
356
|
+
if self._TokenType is not None: msg = '%s\n TokenType="%s"' % (msg, str(self._TokenType))
|
|
357
|
+
if self._Version is not None: msg = '%s\n Version="%s"' % (msg, str(self._Version))
|
|
358
|
+
if self._VoiceSupport is not None: msg = '%s\n VoiceSupport="%s"' % (msg, str(self._VoiceSupport))
|
|
359
|
+
return msg
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# external package imports.
|
|
2
|
+
|
|
3
|
+
# our package imports.
|
|
4
|
+
from ..sautils import export
|
|
5
|
+
|
|
6
|
+
@export
|
|
7
|
+
class ZeroconfGetInfoAlias:
|
|
8
|
+
"""
|
|
9
|
+
Spotify Web API Zeroconf GetInfo Alias object.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def __init__(self, root:dict=None) -> None:
|
|
13
|
+
"""
|
|
14
|
+
Initializes a new instance of the class.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
root (dict):
|
|
18
|
+
Spotify Web API JSON response in dictionary format, used to load object
|
|
19
|
+
attributes; otherwise, None to not load attributes.
|
|
20
|
+
"""
|
|
21
|
+
self._Id:str = None
|
|
22
|
+
self._IsGroup:bool = None
|
|
23
|
+
self._Name:str = None
|
|
24
|
+
|
|
25
|
+
if (root is None):
|
|
26
|
+
|
|
27
|
+
pass
|
|
28
|
+
|
|
29
|
+
else:
|
|
30
|
+
|
|
31
|
+
self._Id = root.get('id', None)
|
|
32
|
+
self._IsGroup = root.get('isGroup', None)
|
|
33
|
+
self._Name = root.get('name', None)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def __repr__(self) -> str:
|
|
37
|
+
return self.ToString()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def __str__(self) -> str:
|
|
41
|
+
return self.ToString()
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@property
|
|
45
|
+
def Id(self) -> str:
|
|
46
|
+
"""
|
|
47
|
+
Unique identifier of the alias.
|
|
48
|
+
"""
|
|
49
|
+
return self._Id
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def IsGroup(self) -> bool:
|
|
54
|
+
"""
|
|
55
|
+
True if the alias is a group; otherwise, False.
|
|
56
|
+
"""
|
|
57
|
+
return self._IsGroup
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@property
|
|
61
|
+
def Name(self) -> str:
|
|
62
|
+
"""
|
|
63
|
+
Display name of the alias.
|
|
64
|
+
"""
|
|
65
|
+
return self._Name
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def ToDictionary(self) -> dict:
|
|
69
|
+
"""
|
|
70
|
+
Returns a dictionary representation of the class.
|
|
71
|
+
"""
|
|
72
|
+
result:dict = \
|
|
73
|
+
{
|
|
74
|
+
'Id': self._Id,
|
|
75
|
+
'IsGroup': self._IsGroup,
|
|
76
|
+
'Name': self._Name,
|
|
77
|
+
}
|
|
78
|
+
return result
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def ToString(self, includeTitle:bool=False) -> str:
|
|
82
|
+
"""
|
|
83
|
+
Returns a displayable string representation of the class.
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
includeTitle (str):
|
|
87
|
+
True to include the class name title prefix.
|
|
88
|
+
"""
|
|
89
|
+
msg:str = ''
|
|
90
|
+
if includeTitle:
|
|
91
|
+
msg = 'ZeroconfGetInfoAlias:'
|
|
92
|
+
|
|
93
|
+
if self._Name is not None: msg = '%s\n Name="%s"' % (msg, str(self._Name))
|
|
94
|
+
if self._Id is not None: msg = '%s\n Id="%s"' % (msg, str(self._Id))
|
|
95
|
+
if self._IsGroup is not None: msg = '%s\n IsGroup="%s"' % (msg, str(self._IsGroup))
|
|
96
|
+
return msg
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# external package imports.
|
|
2
|
+
|
|
3
|
+
# our package imports.
|
|
4
|
+
from ..sautils import export
|
|
5
|
+
|
|
6
|
+
@export
|
|
7
|
+
class ZeroconfGetInfoDrmMediaFormat:
|
|
8
|
+
"""
|
|
9
|
+
Spotify Web API Zeroconf GetInfo DRM Media Format object.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def __init__(self, root:dict=None) -> None:
|
|
13
|
+
"""
|
|
14
|
+
Initializes a new instance of the class.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
root (dict):
|
|
18
|
+
Spotify Web API JSON response in dictionary format, used to load object
|
|
19
|
+
attributes; otherwise, None to not load attributes.
|
|
20
|
+
"""
|
|
21
|
+
self._Drm:int = None
|
|
22
|
+
self._Formats:int = None
|
|
23
|
+
|
|
24
|
+
if (root is None):
|
|
25
|
+
|
|
26
|
+
pass
|
|
27
|
+
|
|
28
|
+
else:
|
|
29
|
+
|
|
30
|
+
self._Drm = root.get('drm', None)
|
|
31
|
+
self._Formats = root.get('formats', None)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def __repr__(self) -> str:
|
|
35
|
+
return self.ToString()
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def __str__(self) -> str:
|
|
39
|
+
return self.ToString()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def Drm(self) -> int:
|
|
44
|
+
"""
|
|
45
|
+
DRM format which the integration supports (SpDrmFormat).
|
|
46
|
+
|
|
47
|
+
kSpDrmFormatUnknown Unknown DRM.
|
|
48
|
+
kSpDrmFormatUnencrypted No DRM, unencrypted.
|
|
49
|
+
kSpDrmFormatFairPlay FairPlay.
|
|
50
|
+
kSpDrmFormatWidevine Widevine.
|
|
51
|
+
kSpDrmFormatPlayReady PlayReady.
|
|
52
|
+
"""
|
|
53
|
+
return self._Drm
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def Formats(self) -> int:
|
|
58
|
+
"""
|
|
59
|
+
Supported media formats for a DRM.
|
|
60
|
+
"""
|
|
61
|
+
return self._Formats
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def ToDictionary(self) -> dict:
|
|
65
|
+
"""
|
|
66
|
+
Returns a dictionary representation of the class.
|
|
67
|
+
"""
|
|
68
|
+
result:dict = \
|
|
69
|
+
{
|
|
70
|
+
'Drm': self._Drm,
|
|
71
|
+
'Formats': self._Formats,
|
|
72
|
+
}
|
|
73
|
+
return result
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def ToString(self, includeTitle:bool=False) -> str:
|
|
77
|
+
"""
|
|
78
|
+
Returns a displayable string representation of the class.
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
includeTitle (str):
|
|
82
|
+
True to include the class name title prefix.
|
|
83
|
+
"""
|
|
84
|
+
msg:str = ''
|
|
85
|
+
if includeTitle:
|
|
86
|
+
msg = 'ZeroconfGetInfoDrmMediaFormat:'
|
|
87
|
+
|
|
88
|
+
if self._Drm is not None: msg = '%s\n Drm=%s' % (msg, str(self._Drm))
|
|
89
|
+
if self._Formats is not None: msg = '%s\n Formats=%s' % (msg, str(self._Formats))
|
|
90
|
+
return msg
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# external package imports.
|
|
2
|
+
|
|
3
|
+
# our package imports.
|
|
4
|
+
from ..sautils import export
|
|
5
|
+
|
|
6
|
+
@export
|
|
7
|
+
class ZeroconfProperty:
|
|
8
|
+
"""
|
|
9
|
+
Zeroconf Property object.
|
|
10
|
+
|
|
11
|
+
Information about a Zeroconf property.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, name:str, value:str) -> None:
|
|
15
|
+
"""
|
|
16
|
+
Initializes a new instance of the class.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
name (str):
|
|
20
|
+
Property name.
|
|
21
|
+
value (str):
|
|
22
|
+
Property value.
|
|
23
|
+
"""
|
|
24
|
+
self._Name:str = name
|
|
25
|
+
self._Value:str = value
|
|
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 Name(self) -> str:
|
|
38
|
+
"""
|
|
39
|
+
Property name.
|
|
40
|
+
"""
|
|
41
|
+
return self._Name
|
|
42
|
+
|
|
43
|
+
@Name.setter
|
|
44
|
+
def Name(self, value:str):
|
|
45
|
+
"""
|
|
46
|
+
Sets the Name property value.
|
|
47
|
+
"""
|
|
48
|
+
if isinstance(value, str):
|
|
49
|
+
self._Name = value
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def Value(self) -> str:
|
|
54
|
+
"""
|
|
55
|
+
Property value.
|
|
56
|
+
"""
|
|
57
|
+
return self._Value
|
|
58
|
+
|
|
59
|
+
@Value.setter
|
|
60
|
+
def Value(self, value:str):
|
|
61
|
+
"""
|
|
62
|
+
Sets the Value property value.
|
|
63
|
+
"""
|
|
64
|
+
self._Value = value
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def ToDictionary(self) -> dict:
|
|
68
|
+
"""
|
|
69
|
+
Returns a dictionary representation of the class.
|
|
70
|
+
"""
|
|
71
|
+
result:dict = \
|
|
72
|
+
{
|
|
73
|
+
'Name': self._Name,
|
|
74
|
+
'Value': self._Value,
|
|
75
|
+
}
|
|
76
|
+
return result
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def ToString(self, includeTitle:bool=False) -> str:
|
|
80
|
+
"""
|
|
81
|
+
Returns a displayable string representation of the class.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
includeTitle (str):
|
|
85
|
+
True to include the class name title prefix.
|
|
86
|
+
"""
|
|
87
|
+
msg:str = ''
|
|
88
|
+
if includeTitle:
|
|
89
|
+
msg = 'ZeroconfProperty:'
|
|
90
|
+
|
|
91
|
+
if self._Name is not None: msg = '%s\n Name="%s"' % (msg, str(self._Name))
|
|
92
|
+
if self._Value is not None: msg = '%s\n Value="%s"' % (msg, str(self._Value))
|
|
93
|
+
return msg
|