universal-mcp-applications 0.1.32__py3-none-any.whl → 0.1.36rc2__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.
- universal_mcp/applications/ahrefs/app.py +52 -198
- universal_mcp/applications/airtable/app.py +23 -122
- universal_mcp/applications/apollo/app.py +111 -464
- universal_mcp/applications/asana/app.py +417 -1567
- universal_mcp/applications/aws_s3/app.py +36 -103
- universal_mcp/applications/bill/app.py +546 -1957
- universal_mcp/applications/box/app.py +1068 -3981
- universal_mcp/applications/braze/app.py +364 -1430
- universal_mcp/applications/browser_use/app.py +2 -8
- universal_mcp/applications/cal_com_v2/app.py +207 -625
- universal_mcp/applications/calendly/app.py +61 -200
- universal_mcp/applications/canva/app.py +45 -110
- universal_mcp/applications/clickup/app.py +207 -674
- universal_mcp/applications/coda/app.py +146 -426
- universal_mcp/applications/confluence/app.py +310 -1098
- universal_mcp/applications/contentful/app.py +36 -151
- universal_mcp/applications/crustdata/app.py +28 -107
- universal_mcp/applications/dialpad/app.py +283 -756
- universal_mcp/applications/digitalocean/app.py +1766 -5777
- universal_mcp/applications/domain_checker/app.py +3 -54
- universal_mcp/applications/e2b/app.py +14 -64
- universal_mcp/applications/elevenlabs/app.py +9 -47
- universal_mcp/applications/exa/app.py +6 -17
- universal_mcp/applications/falai/app.py +24 -101
- universal_mcp/applications/figma/app.py +53 -137
- universal_mcp/applications/file_system/app.py +2 -13
- universal_mcp/applications/firecrawl/app.py +51 -152
- universal_mcp/applications/fireflies/app.py +59 -281
- universal_mcp/applications/fpl/app.py +91 -528
- universal_mcp/applications/fpl/utils/fixtures.py +15 -49
- universal_mcp/applications/fpl/utils/helper.py +25 -89
- universal_mcp/applications/fpl/utils/league_utils.py +20 -64
- universal_mcp/applications/ghost_content/app.py +52 -161
- universal_mcp/applications/github/app.py +19 -56
- universal_mcp/applications/gong/app.py +88 -248
- universal_mcp/applications/google_calendar/app.py +16 -68
- universal_mcp/applications/google_docs/app.py +85 -189
- universal_mcp/applications/google_drive/app.py +141 -463
- universal_mcp/applications/google_gemini/app.py +12 -64
- universal_mcp/applications/google_mail/app.py +28 -157
- universal_mcp/applications/google_searchconsole/app.py +15 -48
- universal_mcp/applications/google_sheet/app.py +100 -581
- universal_mcp/applications/google_sheet/helper.py +10 -37
- universal_mcp/applications/hashnode/app.py +57 -269
- universal_mcp/applications/heygen/app.py +44 -122
- universal_mcp/applications/http_tools/app.py +10 -32
- universal_mcp/applications/hubspot/api_segments/crm_api.py +460 -1573
- universal_mcp/applications/hubspot/api_segments/marketing_api.py +74 -262
- universal_mcp/applications/hubspot/app.py +23 -87
- universal_mcp/applications/jira/app.py +2071 -7986
- universal_mcp/applications/klaviyo/app.py +494 -1376
- universal_mcp/applications/linkedin/README.md +9 -2
- universal_mcp/applications/linkedin/app.py +240 -181
- universal_mcp/applications/mailchimp/app.py +450 -1605
- universal_mcp/applications/markitdown/app.py +8 -20
- universal_mcp/applications/miro/app.py +217 -699
- universal_mcp/applications/ms_teams/app.py +64 -186
- universal_mcp/applications/neon/app.py +86 -192
- universal_mcp/applications/notion/app.py +21 -36
- universal_mcp/applications/onedrive/app.py +16 -38
- universal_mcp/applications/openai/app.py +42 -165
- universal_mcp/applications/outlook/app.py +24 -84
- universal_mcp/applications/perplexity/app.py +4 -19
- universal_mcp/applications/pipedrive/app.py +832 -3142
- universal_mcp/applications/posthog/app.py +163 -432
- universal_mcp/applications/reddit/app.py +40 -139
- universal_mcp/applications/resend/app.py +41 -107
- universal_mcp/applications/retell/app.py +14 -41
- universal_mcp/applications/rocketlane/app.py +221 -934
- universal_mcp/applications/scraper/README.md +7 -4
- universal_mcp/applications/scraper/app.py +50 -109
- universal_mcp/applications/semanticscholar/app.py +22 -64
- universal_mcp/applications/semrush/app.py +43 -77
- universal_mcp/applications/sendgrid/app.py +512 -1262
- universal_mcp/applications/sentry/app.py +271 -906
- universal_mcp/applications/serpapi/app.py +40 -143
- universal_mcp/applications/sharepoint/app.py +17 -39
- universal_mcp/applications/shopify/app.py +1551 -4287
- universal_mcp/applications/shortcut/app.py +155 -417
- universal_mcp/applications/slack/app.py +33 -115
- universal_mcp/applications/spotify/app.py +126 -325
- universal_mcp/applications/supabase/app.py +104 -213
- universal_mcp/applications/tavily/app.py +1 -1
- universal_mcp/applications/trello/app.py +693 -2656
- universal_mcp/applications/twilio/app.py +14 -50
- universal_mcp/applications/twitter/api_segments/compliance_api.py +4 -14
- universal_mcp/applications/twitter/api_segments/dm_conversations_api.py +6 -18
- universal_mcp/applications/twitter/api_segments/likes_api.py +1 -3
- universal_mcp/applications/twitter/api_segments/lists_api.py +5 -15
- universal_mcp/applications/twitter/api_segments/trends_api.py +1 -3
- universal_mcp/applications/twitter/api_segments/tweets_api.py +9 -31
- universal_mcp/applications/twitter/api_segments/usage_api.py +1 -5
- universal_mcp/applications/twitter/api_segments/users_api.py +14 -42
- universal_mcp/applications/whatsapp/app.py +35 -186
- universal_mcp/applications/whatsapp/audio.py +2 -6
- universal_mcp/applications/whatsapp/whatsapp.py +17 -51
- universal_mcp/applications/whatsapp_business/app.py +70 -283
- universal_mcp/applications/wrike/app.py +45 -118
- universal_mcp/applications/yahoo_finance/app.py +19 -65
- universal_mcp/applications/youtube/app.py +75 -261
- universal_mcp/applications/zenquotes/app.py +2 -2
- {universal_mcp_applications-0.1.32.dist-info → universal_mcp_applications-0.1.36rc2.dist-info}/METADATA +2 -2
- {universal_mcp_applications-0.1.32.dist-info → universal_mcp_applications-0.1.36rc2.dist-info}/RECORD +105 -105
- {universal_mcp_applications-0.1.32.dist-info → universal_mcp_applications-0.1.36rc2.dist-info}/WHEEL +0 -0
- {universal_mcp_applications-0.1.32.dist-info → universal_mcp_applications-0.1.36rc2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from typing import Any
|
|
2
|
-
|
|
3
2
|
from universal_mcp.applications.application import APIApplication
|
|
4
3
|
from universal_mcp.integrations import Integration
|
|
5
4
|
|
|
@@ -9,7 +8,7 @@ class SpotifyApp(APIApplication):
|
|
|
9
8
|
super().__init__(name="spotify", integration=integration, **kwargs)
|
|
10
9
|
self.base_url = "https://api.spotify.com/v1"
|
|
11
10
|
|
|
12
|
-
def get_an_album(self, id, market=None) -> Any:
|
|
11
|
+
async def get_an_album(self, id, market=None) -> Any:
|
|
13
12
|
"""
|
|
14
13
|
Retrieves detailed information about a specific album by its ID from the API.
|
|
15
14
|
|
|
@@ -35,7 +34,7 @@ class SpotifyApp(APIApplication):
|
|
|
35
34
|
response.raise_for_status()
|
|
36
35
|
return response.json()
|
|
37
36
|
|
|
38
|
-
def get_multiple_albums(self, ids, market=None) -> Any:
|
|
37
|
+
async def get_multiple_albums(self, ids, market=None) -> Any:
|
|
39
38
|
"""
|
|
40
39
|
Retrieves detailed information for multiple albums by their IDs from the API.
|
|
41
40
|
|
|
@@ -56,14 +55,12 @@ class SpotifyApp(APIApplication):
|
|
|
56
55
|
if ids is None:
|
|
57
56
|
raise ValueError("Missing required parameter 'ids'")
|
|
58
57
|
url = f"{self.base_url}/albums"
|
|
59
|
-
query_params = {
|
|
60
|
-
k: v for k, v in [("ids", ids), ("market", market)] if v is not None
|
|
61
|
-
}
|
|
58
|
+
query_params = {k: v for k, v in [("ids", ids), ("market", market)] if v is not None}
|
|
62
59
|
response = self._get(url, params=query_params)
|
|
63
60
|
response.raise_for_status()
|
|
64
61
|
return response.json()
|
|
65
62
|
|
|
66
|
-
def get_an_albums_tracks(self, id, market=None, limit=None, offset=None) -> Any:
|
|
63
|
+
async def get_an_albums_tracks(self, id, market=None, limit=None, offset=None) -> Any:
|
|
67
64
|
"""
|
|
68
65
|
Retrieves the list of tracks for a specified album from the API, with optional filtering and pagination.
|
|
69
66
|
|
|
@@ -86,16 +83,12 @@ class SpotifyApp(APIApplication):
|
|
|
86
83
|
if id is None:
|
|
87
84
|
raise ValueError("Missing required parameter 'id'")
|
|
88
85
|
url = f"{self.base_url}/albums/{id}/tracks"
|
|
89
|
-
query_params = {
|
|
90
|
-
k: v
|
|
91
|
-
for k, v in [("market", market), ("limit", limit), ("offset", offset)]
|
|
92
|
-
if v is not None
|
|
93
|
-
}
|
|
86
|
+
query_params = {k: v for k, v in [("market", market), ("limit", limit), ("offset", offset)] if v is not None}
|
|
94
87
|
response = self._get(url, params=query_params)
|
|
95
88
|
response.raise_for_status()
|
|
96
89
|
return response.json()
|
|
97
90
|
|
|
98
|
-
def get_an_artist(self, id) -> Any:
|
|
91
|
+
async def get_an_artist(self, id) -> Any:
|
|
99
92
|
"""
|
|
100
93
|
Retrieve detailed information about a specific artist by their unique identifier.
|
|
101
94
|
|
|
@@ -120,7 +113,7 @@ class SpotifyApp(APIApplication):
|
|
|
120
113
|
response.raise_for_status()
|
|
121
114
|
return response.json()
|
|
122
115
|
|
|
123
|
-
def get_multiple_artists(self, ids) -> Any:
|
|
116
|
+
async def get_multiple_artists(self, ids) -> Any:
|
|
124
117
|
"""
|
|
125
118
|
Retrieves information for multiple artists using their IDs.
|
|
126
119
|
|
|
@@ -145,9 +138,7 @@ class SpotifyApp(APIApplication):
|
|
|
145
138
|
response.raise_for_status()
|
|
146
139
|
return response.json()
|
|
147
140
|
|
|
148
|
-
def get_an_artists_albums(
|
|
149
|
-
self, id, include_groups=None, market=None, limit=None, offset=None
|
|
150
|
-
) -> Any:
|
|
141
|
+
async def get_an_artists_albums(self, id, include_groups=None, market=None, limit=None, offset=None) -> Any:
|
|
151
142
|
"""
|
|
152
143
|
Retrieves a list of albums for the specified artist from the API.
|
|
153
144
|
|
|
@@ -172,20 +163,13 @@ class SpotifyApp(APIApplication):
|
|
|
172
163
|
raise ValueError("Missing required parameter 'id'")
|
|
173
164
|
url = f"{self.base_url}/artists/{id}/albums"
|
|
174
165
|
query_params = {
|
|
175
|
-
k: v
|
|
176
|
-
for k, v in [
|
|
177
|
-
("include_groups", include_groups),
|
|
178
|
-
("market", market),
|
|
179
|
-
("limit", limit),
|
|
180
|
-
("offset", offset),
|
|
181
|
-
]
|
|
182
|
-
if v is not None
|
|
166
|
+
k: v for k, v in [("include_groups", include_groups), ("market", market), ("limit", limit), ("offset", offset)] if v is not None
|
|
183
167
|
}
|
|
184
168
|
response = self._get(url, params=query_params)
|
|
185
169
|
response.raise_for_status()
|
|
186
170
|
return response.json()
|
|
187
171
|
|
|
188
|
-
def get_an_artists_top_tracks(self, id, market=None) -> Any:
|
|
172
|
+
async def get_an_artists_top_tracks(self, id, market=None) -> Any:
|
|
189
173
|
"""
|
|
190
174
|
Retrieves the top tracks for a specified artist from the API.
|
|
191
175
|
|
|
@@ -211,7 +195,7 @@ class SpotifyApp(APIApplication):
|
|
|
211
195
|
response.raise_for_status()
|
|
212
196
|
return response.json()
|
|
213
197
|
|
|
214
|
-
def get_an_artists_related_artists(self, id) -> Any:
|
|
198
|
+
async def get_an_artists_related_artists(self, id) -> Any:
|
|
215
199
|
"""
|
|
216
200
|
Retrieves a list of artists related to the specified artist by their unique ID.
|
|
217
201
|
|
|
@@ -236,7 +220,7 @@ class SpotifyApp(APIApplication):
|
|
|
236
220
|
response.raise_for_status()
|
|
237
221
|
return response.json()
|
|
238
222
|
|
|
239
|
-
def get_a_show(self, id, market=None) -> Any:
|
|
223
|
+
async def get_a_show(self, id, market=None) -> Any:
|
|
240
224
|
"""
|
|
241
225
|
Retrieve detailed information about a show by its unique identifier.
|
|
242
226
|
|
|
@@ -262,7 +246,7 @@ class SpotifyApp(APIApplication):
|
|
|
262
246
|
response.raise_for_status()
|
|
263
247
|
return response.json()
|
|
264
248
|
|
|
265
|
-
def get_multiple_shows(self, ids, market=None) -> Any:
|
|
249
|
+
async def get_multiple_shows(self, ids, market=None) -> Any:
|
|
266
250
|
"""
|
|
267
251
|
Retrieves information for multiple shows by their IDs, with optional market filtering.
|
|
268
252
|
|
|
@@ -283,14 +267,12 @@ class SpotifyApp(APIApplication):
|
|
|
283
267
|
if ids is None:
|
|
284
268
|
raise ValueError("Missing required parameter 'ids'")
|
|
285
269
|
url = f"{self.base_url}/shows"
|
|
286
|
-
query_params = {
|
|
287
|
-
k: v for k, v in [("market", market), ("ids", ids)] if v is not None
|
|
288
|
-
}
|
|
270
|
+
query_params = {k: v for k, v in [("market", market), ("ids", ids)] if v is not None}
|
|
289
271
|
response = self._get(url, params=query_params)
|
|
290
272
|
response.raise_for_status()
|
|
291
273
|
return response.json()
|
|
292
274
|
|
|
293
|
-
def get_a_shows_episodes(self, id, market=None, limit=None, offset=None) -> Any:
|
|
275
|
+
async def get_a_shows_episodes(self, id, market=None, limit=None, offset=None) -> Any:
|
|
294
276
|
"""
|
|
295
277
|
Retrieves episodes for a specific show from the API with optional market, limit, and offset parameters.
|
|
296
278
|
|
|
@@ -313,16 +295,12 @@ class SpotifyApp(APIApplication):
|
|
|
313
295
|
if id is None:
|
|
314
296
|
raise ValueError("Missing required parameter 'id'")
|
|
315
297
|
url = f"{self.base_url}/shows/{id}/episodes"
|
|
316
|
-
query_params = {
|
|
317
|
-
k: v
|
|
318
|
-
for k, v in [("market", market), ("limit", limit), ("offset", offset)]
|
|
319
|
-
if v is not None
|
|
320
|
-
}
|
|
298
|
+
query_params = {k: v for k, v in [("market", market), ("limit", limit), ("offset", offset)] if v is not None}
|
|
321
299
|
response = self._get(url, params=query_params)
|
|
322
300
|
response.raise_for_status()
|
|
323
301
|
return response.json()
|
|
324
302
|
|
|
325
|
-
def get_an_episode(self, id, market=None) -> Any:
|
|
303
|
+
async def get_an_episode(self, id, market=None) -> Any:
|
|
326
304
|
"""
|
|
327
305
|
Retrieves a single podcast episode's details by its unique identifier.
|
|
328
306
|
|
|
@@ -348,7 +326,7 @@ class SpotifyApp(APIApplication):
|
|
|
348
326
|
response.raise_for_status()
|
|
349
327
|
return response.json()
|
|
350
328
|
|
|
351
|
-
def get_multiple_episodes(self, ids, market=None) -> Any:
|
|
329
|
+
async def get_multiple_episodes(self, ids, market=None) -> Any:
|
|
352
330
|
"""
|
|
353
331
|
Retrieves details for multiple podcast episodes using their IDs, optionally filtered by market.
|
|
354
332
|
|
|
@@ -369,14 +347,12 @@ class SpotifyApp(APIApplication):
|
|
|
369
347
|
if ids is None:
|
|
370
348
|
raise ValueError("Missing required parameter 'ids'")
|
|
371
349
|
url = f"{self.base_url}/episodes"
|
|
372
|
-
query_params = {
|
|
373
|
-
k: v for k, v in [("ids", ids), ("market", market)] if v is not None
|
|
374
|
-
}
|
|
350
|
+
query_params = {k: v for k, v in [("ids", ids), ("market", market)] if v is not None}
|
|
375
351
|
response = self._get(url, params=query_params)
|
|
376
352
|
response.raise_for_status()
|
|
377
353
|
return response.json()
|
|
378
354
|
|
|
379
|
-
def get_an_audiobook(self, id, market=None) -> Any:
|
|
355
|
+
async def get_an_audiobook(self, id, market=None) -> Any:
|
|
380
356
|
"""
|
|
381
357
|
Retrieves detailed information about a specific audiobook by ID, optionally filtered by market.
|
|
382
358
|
|
|
@@ -402,7 +378,7 @@ class SpotifyApp(APIApplication):
|
|
|
402
378
|
response.raise_for_status()
|
|
403
379
|
return response.json()
|
|
404
380
|
|
|
405
|
-
def get_multiple_audiobooks(self, ids, market=None) -> Any:
|
|
381
|
+
async def get_multiple_audiobooks(self, ids, market=None) -> Any:
|
|
406
382
|
"""
|
|
407
383
|
Fetches details for multiple audiobooks by their IDs, optionally filtered by market.
|
|
408
384
|
|
|
@@ -423,14 +399,12 @@ class SpotifyApp(APIApplication):
|
|
|
423
399
|
if ids is None:
|
|
424
400
|
raise ValueError("Missing required parameter 'ids'")
|
|
425
401
|
url = f"{self.base_url}/audiobooks"
|
|
426
|
-
query_params = {
|
|
427
|
-
k: v for k, v in [("ids", ids), ("market", market)] if v is not None
|
|
428
|
-
}
|
|
402
|
+
query_params = {k: v for k, v in [("ids", ids), ("market", market)] if v is not None}
|
|
429
403
|
response = self._get(url, params=query_params)
|
|
430
404
|
response.raise_for_status()
|
|
431
405
|
return response.json()
|
|
432
406
|
|
|
433
|
-
def get_audiobook_chapters(self, id, market=None, limit=None, offset=None) -> Any:
|
|
407
|
+
async def get_audiobook_chapters(self, id, market=None, limit=None, offset=None) -> Any:
|
|
434
408
|
"""
|
|
435
409
|
Retrieves the chapters for a specified audiobook from the API.
|
|
436
410
|
|
|
@@ -453,16 +427,12 @@ class SpotifyApp(APIApplication):
|
|
|
453
427
|
if id is None:
|
|
454
428
|
raise ValueError("Missing required parameter 'id'")
|
|
455
429
|
url = f"{self.base_url}/audiobooks/{id}/chapters"
|
|
456
|
-
query_params = {
|
|
457
|
-
k: v
|
|
458
|
-
for k, v in [("market", market), ("limit", limit), ("offset", offset)]
|
|
459
|
-
if v is not None
|
|
460
|
-
}
|
|
430
|
+
query_params = {k: v for k, v in [("market", market), ("limit", limit), ("offset", offset)] if v is not None}
|
|
461
431
|
response = self._get(url, params=query_params)
|
|
462
432
|
response.raise_for_status()
|
|
463
433
|
return response.json()
|
|
464
434
|
|
|
465
|
-
def get_users_saved_audiobooks(self, limit=None, offset=None) -> Any:
|
|
435
|
+
async def get_users_saved_audiobooks(self, limit=None, offset=None) -> Any:
|
|
466
436
|
"""
|
|
467
437
|
Retrieves the current user's saved audiobooks from the API with optional pagination.
|
|
468
438
|
|
|
@@ -480,14 +450,12 @@ class SpotifyApp(APIApplication):
|
|
|
480
450
|
get, list, audiobooks, user-data, api
|
|
481
451
|
"""
|
|
482
452
|
url = f"{self.base_url}/me/audiobooks"
|
|
483
|
-
query_params = {
|
|
484
|
-
k: v for k, v in [("limit", limit), ("offset", offset)] if v is not None
|
|
485
|
-
}
|
|
453
|
+
query_params = {k: v for k, v in [("limit", limit), ("offset", offset)] if v is not None}
|
|
486
454
|
response = self._get(url, params=query_params)
|
|
487
455
|
response.raise_for_status()
|
|
488
456
|
return response.json()
|
|
489
457
|
|
|
490
|
-
def save_audiobooks_user(self, ids) -> Any:
|
|
458
|
+
async def save_audiobooks_user(self, ids) -> Any:
|
|
491
459
|
"""
|
|
492
460
|
Saves one or more audiobooks to the current user's library.
|
|
493
461
|
|
|
@@ -512,7 +480,7 @@ class SpotifyApp(APIApplication):
|
|
|
512
480
|
response.raise_for_status()
|
|
513
481
|
return response.json()
|
|
514
482
|
|
|
515
|
-
def remove_audiobooks_user(self, ids) -> Any:
|
|
483
|
+
async def remove_audiobooks_user(self, ids) -> Any:
|
|
516
484
|
"""
|
|
517
485
|
Removes one or more audiobooks from the authenticated user's library.
|
|
518
486
|
|
|
@@ -537,7 +505,7 @@ class SpotifyApp(APIApplication):
|
|
|
537
505
|
response.raise_for_status()
|
|
538
506
|
return response.json()
|
|
539
507
|
|
|
540
|
-
def check_users_saved_audiobooks(self, ids) -> Any:
|
|
508
|
+
async def check_users_saved_audiobooks(self, ids) -> Any:
|
|
541
509
|
"""
|
|
542
510
|
Checks if the specified audiobooks are saved in the current user's library.
|
|
543
511
|
|
|
@@ -562,7 +530,7 @@ class SpotifyApp(APIApplication):
|
|
|
562
530
|
response.raise_for_status()
|
|
563
531
|
return response.json()
|
|
564
532
|
|
|
565
|
-
def get_a_chapter(self, id, market=None) -> Any:
|
|
533
|
+
async def get_a_chapter(self, id, market=None) -> Any:
|
|
566
534
|
"""
|
|
567
535
|
Retrieves a specific chapter's details by ID from the API, optionally filtering by market.
|
|
568
536
|
|
|
@@ -588,7 +556,7 @@ class SpotifyApp(APIApplication):
|
|
|
588
556
|
response.raise_for_status()
|
|
589
557
|
return response.json()
|
|
590
558
|
|
|
591
|
-
def get_several_chapters(self, ids, market=None) -> Any:
|
|
559
|
+
async def get_several_chapters(self, ids, market=None) -> Any:
|
|
592
560
|
"""
|
|
593
561
|
Retrieve details for multiple chapters based on their IDs, optionally filtering by market.
|
|
594
562
|
|
|
@@ -609,14 +577,12 @@ class SpotifyApp(APIApplication):
|
|
|
609
577
|
if ids is None:
|
|
610
578
|
raise ValueError("Missing required parameter 'ids'")
|
|
611
579
|
url = f"{self.base_url}/chapters"
|
|
612
|
-
query_params = {
|
|
613
|
-
k: v for k, v in [("ids", ids), ("market", market)] if v is not None
|
|
614
|
-
}
|
|
580
|
+
query_params = {k: v for k, v in [("ids", ids), ("market", market)] if v is not None}
|
|
615
581
|
response = self._get(url, params=query_params)
|
|
616
582
|
response.raise_for_status()
|
|
617
583
|
return response.json()
|
|
618
584
|
|
|
619
|
-
def get_track(self, id, market=None) -> Any:
|
|
585
|
+
async def get_track(self, id, market=None) -> Any:
|
|
620
586
|
"""
|
|
621
587
|
Retrieves detailed information about a track by its unique identifier from the external API.
|
|
622
588
|
|
|
@@ -642,7 +608,7 @@ class SpotifyApp(APIApplication):
|
|
|
642
608
|
response.raise_for_status()
|
|
643
609
|
return response.json()
|
|
644
610
|
|
|
645
|
-
def get_several_tracks(self, ids, market=None) -> Any:
|
|
611
|
+
async def get_several_tracks(self, ids, market=None) -> Any:
|
|
646
612
|
"""
|
|
647
613
|
Retrieves metadata for multiple tracks based on their IDs from the API.
|
|
648
614
|
|
|
@@ -663,16 +629,12 @@ class SpotifyApp(APIApplication):
|
|
|
663
629
|
if ids is None:
|
|
664
630
|
raise ValueError("Missing required parameter 'ids'")
|
|
665
631
|
url = f"{self.base_url}/tracks"
|
|
666
|
-
query_params = {
|
|
667
|
-
k: v for k, v in [("market", market), ("ids", ids)] if v is not None
|
|
668
|
-
}
|
|
632
|
+
query_params = {k: v for k, v in [("market", market), ("ids", ids)] if v is not None}
|
|
669
633
|
response = self._get(url, params=query_params)
|
|
670
634
|
response.raise_for_status()
|
|
671
635
|
return response.json()
|
|
672
636
|
|
|
673
|
-
def search(
|
|
674
|
-
self, q, type, market=None, limit=None, offset=None, include_external=None
|
|
675
|
-
) -> Any:
|
|
637
|
+
async def search(self, q, type, market=None, limit=None, offset=None, include_external=None) -> Any:
|
|
676
638
|
"""
|
|
677
639
|
Performs a search query against the API and returns the matching results as a JSON object.
|
|
678
640
|
|
|
@@ -715,9 +677,7 @@ class SpotifyApp(APIApplication):
|
|
|
715
677
|
response.raise_for_status()
|
|
716
678
|
return response.json()
|
|
717
679
|
|
|
718
|
-
def get_current_users_profile(
|
|
719
|
-
self,
|
|
720
|
-
) -> Any:
|
|
680
|
+
async def get_current_users_profile(self) -> Any:
|
|
721
681
|
"""
|
|
722
682
|
Retrieves the current authenticated user's profile information from the API.
|
|
723
683
|
|
|
@@ -739,9 +699,7 @@ class SpotifyApp(APIApplication):
|
|
|
739
699
|
response.raise_for_status()
|
|
740
700
|
return response.json()
|
|
741
701
|
|
|
742
|
-
def get_playlist(
|
|
743
|
-
self, playlist_id, market=None, fields=None, additional_types=None
|
|
744
|
-
) -> Any:
|
|
702
|
+
async def get_playlist(self, playlist_id, market=None, fields=None, additional_types=None) -> Any:
|
|
745
703
|
"""
|
|
746
704
|
Retrieves a playlist from the API using the specified playlist ID.
|
|
747
705
|
|
|
@@ -764,22 +722,12 @@ class SpotifyApp(APIApplication):
|
|
|
764
722
|
if playlist_id is None:
|
|
765
723
|
raise ValueError("Missing required parameter 'playlist_id'")
|
|
766
724
|
url = f"{self.base_url}/playlists/{playlist_id}"
|
|
767
|
-
query_params = {
|
|
768
|
-
k: v
|
|
769
|
-
for k, v in [
|
|
770
|
-
("market", market),
|
|
771
|
-
("fields", fields),
|
|
772
|
-
("additional_types", additional_types),
|
|
773
|
-
]
|
|
774
|
-
if v is not None
|
|
775
|
-
}
|
|
725
|
+
query_params = {k: v for k, v in [("market", market), ("fields", fields), ("additional_types", additional_types)] if v is not None}
|
|
776
726
|
response = self._get(url, params=query_params)
|
|
777
727
|
response.raise_for_status()
|
|
778
728
|
return response.json()
|
|
779
729
|
|
|
780
|
-
def change_playlist_details(
|
|
781
|
-
self, playlist_id, name=None, public=None, collaborative=None, description=None
|
|
782
|
-
) -> Any:
|
|
730
|
+
async def change_playlist_details(self, playlist_id, name=None, public=None, collaborative=None, description=None) -> Any:
|
|
783
731
|
"""
|
|
784
732
|
Update the details of an existing playlist with the specified attributes.
|
|
785
733
|
|
|
@@ -802,12 +750,7 @@ class SpotifyApp(APIApplication):
|
|
|
802
750
|
"""
|
|
803
751
|
if playlist_id is None:
|
|
804
752
|
raise ValueError("Missing required parameter 'playlist_id'")
|
|
805
|
-
request_body = {
|
|
806
|
-
"name": name,
|
|
807
|
-
"public": public,
|
|
808
|
-
"collaborative": collaborative,
|
|
809
|
-
"description": description,
|
|
810
|
-
}
|
|
753
|
+
request_body = {"name": name, "public": public, "collaborative": collaborative, "description": description}
|
|
811
754
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
812
755
|
url = f"{self.base_url}/playlists/{playlist_id}"
|
|
813
756
|
query_params = {}
|
|
@@ -815,15 +758,7 @@ class SpotifyApp(APIApplication):
|
|
|
815
758
|
response.raise_for_status()
|
|
816
759
|
return response.json()
|
|
817
760
|
|
|
818
|
-
def get_playlists_tracks(
|
|
819
|
-
self,
|
|
820
|
-
playlist_id,
|
|
821
|
-
market=None,
|
|
822
|
-
fields=None,
|
|
823
|
-
limit=None,
|
|
824
|
-
offset=None,
|
|
825
|
-
additional_types=None,
|
|
826
|
-
) -> Any:
|
|
761
|
+
async def get_playlists_tracks(self, playlist_id, market=None, fields=None, limit=None, offset=None, additional_types=None) -> Any:
|
|
827
762
|
"""
|
|
828
763
|
Retrieves the tracks of a specified playlist from the API, applying optional filters and pagination parameters.
|
|
829
764
|
|
|
@@ -863,7 +798,7 @@ class SpotifyApp(APIApplication):
|
|
|
863
798
|
response.raise_for_status()
|
|
864
799
|
return response.json()
|
|
865
800
|
|
|
866
|
-
def add_tracks_to_playlist(self, playlist_id, position=None, uris=None) -> Any:
|
|
801
|
+
async def add_tracks_to_playlist(self, playlist_id, position=None, uris=None) -> Any:
|
|
867
802
|
"""
|
|
868
803
|
Adds one or more tracks to a specified playlist at an optional position.
|
|
869
804
|
|
|
@@ -884,27 +819,16 @@ class SpotifyApp(APIApplication):
|
|
|
884
819
|
"""
|
|
885
820
|
if playlist_id is None:
|
|
886
821
|
raise ValueError("Missing required parameter 'playlist_id'")
|
|
887
|
-
request_body = {
|
|
888
|
-
"uris": uris,
|
|
889
|
-
"position": position,
|
|
890
|
-
}
|
|
822
|
+
request_body = {"uris": uris, "position": position}
|
|
891
823
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
892
824
|
url = f"{self.base_url}/playlists/{playlist_id}/tracks"
|
|
893
|
-
query_params = {
|
|
894
|
-
k: v for k, v in [("position", position), ("uris", uris)] if v is not None
|
|
895
|
-
}
|
|
825
|
+
query_params = {k: v for k, v in [("position", position), ("uris", uris)] if v is not None}
|
|
896
826
|
response = self._post(url, data=request_body, params=query_params)
|
|
897
827
|
response.raise_for_status()
|
|
898
828
|
return response.json()
|
|
899
829
|
|
|
900
|
-
def reorder_or_replace_playlists_tracks(
|
|
901
|
-
self,
|
|
902
|
-
playlist_id,
|
|
903
|
-
uris=None,
|
|
904
|
-
range_start=None,
|
|
905
|
-
insert_before=None,
|
|
906
|
-
range_length=None,
|
|
907
|
-
snapshot_id=None,
|
|
830
|
+
async def reorder_or_replace_playlists_tracks(
|
|
831
|
+
self, playlist_id, uris=None, range_start=None, insert_before=None, range_length=None, snapshot_id=None
|
|
908
832
|
) -> Any:
|
|
909
833
|
"""
|
|
910
834
|
Reorders or replaces tracks in a playlist by moving, inserting, or replacing track entries using the specified parameters.
|
|
@@ -943,7 +867,7 @@ class SpotifyApp(APIApplication):
|
|
|
943
867
|
response.raise_for_status()
|
|
944
868
|
return response.json()
|
|
945
869
|
|
|
946
|
-
def get_a_list_of_current_users_playlists(self, limit=None, offset=None) -> Any:
|
|
870
|
+
async def get_a_list_of_current_users_playlists(self, limit=None, offset=None) -> Any:
|
|
947
871
|
"""
|
|
948
872
|
Retrieves a list of the current user's playlists with optional pagination controls.
|
|
949
873
|
|
|
@@ -961,14 +885,12 @@ class SpotifyApp(APIApplication):
|
|
|
961
885
|
list, playlists, user, api
|
|
962
886
|
"""
|
|
963
887
|
url = f"{self.base_url}/me/playlists"
|
|
964
|
-
query_params = {
|
|
965
|
-
k: v for k, v in [("limit", limit), ("offset", offset)] if v is not None
|
|
966
|
-
}
|
|
888
|
+
query_params = {k: v for k, v in [("limit", limit), ("offset", offset)] if v is not None}
|
|
967
889
|
response = self._get(url, params=query_params)
|
|
968
890
|
response.raise_for_status()
|
|
969
891
|
return response.json()
|
|
970
892
|
|
|
971
|
-
def get_users_saved_albums(self, limit=None, offset=None, market=None) -> Any:
|
|
893
|
+
async def get_users_saved_albums(self, limit=None, offset=None, market=None) -> Any:
|
|
972
894
|
"""
|
|
973
895
|
Retrieves the current user's saved albums from the Spotify library with optional pagination and market filtering.
|
|
974
896
|
|
|
@@ -987,16 +909,12 @@ class SpotifyApp(APIApplication):
|
|
|
987
909
|
get, list, albums, user-library, spotify, api
|
|
988
910
|
"""
|
|
989
911
|
url = f"{self.base_url}/me/albums"
|
|
990
|
-
query_params = {
|
|
991
|
-
k: v
|
|
992
|
-
for k, v in [("limit", limit), ("offset", offset), ("market", market)]
|
|
993
|
-
if v is not None
|
|
994
|
-
}
|
|
912
|
+
query_params = {k: v for k, v in [("limit", limit), ("offset", offset), ("market", market)] if v is not None}
|
|
995
913
|
response = self._get(url, params=query_params)
|
|
996
914
|
response.raise_for_status()
|
|
997
915
|
return response.json()
|
|
998
916
|
|
|
999
|
-
def check_users_saved_albums(self, ids) -> Any:
|
|
917
|
+
async def check_users_saved_albums(self, ids) -> Any:
|
|
1000
918
|
"""
|
|
1001
919
|
Checks if the specified albums are saved in the current user's Spotify library.
|
|
1002
920
|
|
|
@@ -1021,7 +939,7 @@ class SpotifyApp(APIApplication):
|
|
|
1021
939
|
response.raise_for_status()
|
|
1022
940
|
return response.json()
|
|
1023
941
|
|
|
1024
|
-
def get_users_saved_tracks(self, market=None, limit=None, offset=None) -> Any:
|
|
942
|
+
async def get_users_saved_tracks(self, market=None, limit=None, offset=None) -> Any:
|
|
1025
943
|
"""
|
|
1026
944
|
Retrieves the current user's saved tracks from the Spotify library with optional filtering and pagination.
|
|
1027
945
|
|
|
@@ -1040,16 +958,12 @@ class SpotifyApp(APIApplication):
|
|
|
1040
958
|
list, get, user-data, spotify, tracks, batch
|
|
1041
959
|
"""
|
|
1042
960
|
url = f"{self.base_url}/me/tracks"
|
|
1043
|
-
query_params = {
|
|
1044
|
-
k: v
|
|
1045
|
-
for k, v in [("market", market), ("limit", limit), ("offset", offset)]
|
|
1046
|
-
if v is not None
|
|
1047
|
-
}
|
|
961
|
+
query_params = {k: v for k, v in [("market", market), ("limit", limit), ("offset", offset)] if v is not None}
|
|
1048
962
|
response = self._get(url, params=query_params)
|
|
1049
963
|
response.raise_for_status()
|
|
1050
964
|
return response.json()
|
|
1051
965
|
|
|
1052
|
-
def save_tracks_user(self, ids) -> Any:
|
|
966
|
+
async def save_tracks_user(self, ids) -> Any:
|
|
1053
967
|
"""
|
|
1054
968
|
Saves one or more tracks to the current user's music library.
|
|
1055
969
|
|
|
@@ -1068,9 +982,7 @@ class SpotifyApp(APIApplication):
|
|
|
1068
982
|
"""
|
|
1069
983
|
if ids is None:
|
|
1070
984
|
raise ValueError("Missing required parameter 'ids'")
|
|
1071
|
-
request_body = {
|
|
1072
|
-
"ids": ids,
|
|
1073
|
-
}
|
|
985
|
+
request_body = {"ids": ids}
|
|
1074
986
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
1075
987
|
url = f"{self.base_url}/me/tracks"
|
|
1076
988
|
query_params = {k: v for k, v in [("ids", ids)] if v is not None}
|
|
@@ -1078,7 +990,7 @@ class SpotifyApp(APIApplication):
|
|
|
1078
990
|
response.raise_for_status()
|
|
1079
991
|
return response.json()
|
|
1080
992
|
|
|
1081
|
-
def check_users_saved_tracks(self, ids) -> Any:
|
|
993
|
+
async def check_users_saved_tracks(self, ids) -> Any:
|
|
1082
994
|
"""
|
|
1083
995
|
Checks if the current user has saved specific tracks in their Spotify library.
|
|
1084
996
|
|
|
@@ -1103,7 +1015,7 @@ class SpotifyApp(APIApplication):
|
|
|
1103
1015
|
response.raise_for_status()
|
|
1104
1016
|
return response.json()
|
|
1105
1017
|
|
|
1106
|
-
def get_users_saved_episodes(self, market=None, limit=None, offset=None) -> Any:
|
|
1018
|
+
async def get_users_saved_episodes(self, market=None, limit=None, offset=None) -> Any:
|
|
1107
1019
|
"""
|
|
1108
1020
|
Retrieves the current user's saved podcast episodes from the service, with optional support for market, pagination, and result limits.
|
|
1109
1021
|
|
|
@@ -1122,16 +1034,12 @@ class SpotifyApp(APIApplication):
|
|
|
1122
1034
|
get, list, user-content, episodes, ai
|
|
1123
1035
|
"""
|
|
1124
1036
|
url = f"{self.base_url}/me/episodes"
|
|
1125
|
-
query_params = {
|
|
1126
|
-
k: v
|
|
1127
|
-
for k, v in [("market", market), ("limit", limit), ("offset", offset)]
|
|
1128
|
-
if v is not None
|
|
1129
|
-
}
|
|
1037
|
+
query_params = {k: v for k, v in [("market", market), ("limit", limit), ("offset", offset)] if v is not None}
|
|
1130
1038
|
response = self._get(url, params=query_params)
|
|
1131
1039
|
response.raise_for_status()
|
|
1132
1040
|
return response.json()
|
|
1133
1041
|
|
|
1134
|
-
def save_episodes_user(self, ids) -> Any:
|
|
1042
|
+
async def save_episodes_user(self, ids) -> Any:
|
|
1135
1043
|
"""
|
|
1136
1044
|
Saves episodes to the user's library using the provided list of episode IDs.
|
|
1137
1045
|
|
|
@@ -1150,9 +1058,7 @@ class SpotifyApp(APIApplication):
|
|
|
1150
1058
|
"""
|
|
1151
1059
|
if ids is None:
|
|
1152
1060
|
raise ValueError("Missing required parameter 'ids'")
|
|
1153
|
-
request_body = {
|
|
1154
|
-
"ids": ids,
|
|
1155
|
-
}
|
|
1061
|
+
request_body = {"ids": ids}
|
|
1156
1062
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
1157
1063
|
url = f"{self.base_url}/me/episodes"
|
|
1158
1064
|
query_params = {k: v for k, v in [("ids", ids)] if v is not None}
|
|
@@ -1160,7 +1066,7 @@ class SpotifyApp(APIApplication):
|
|
|
1160
1066
|
response.raise_for_status()
|
|
1161
1067
|
return response.json()
|
|
1162
1068
|
|
|
1163
|
-
def check_users_saved_episodes(self, ids) -> Any:
|
|
1069
|
+
async def check_users_saved_episodes(self, ids) -> Any:
|
|
1164
1070
|
"""
|
|
1165
1071
|
Checks if the specified episodes are saved in the current user's library.
|
|
1166
1072
|
|
|
@@ -1185,7 +1091,7 @@ class SpotifyApp(APIApplication):
|
|
|
1185
1091
|
response.raise_for_status()
|
|
1186
1092
|
return response.json()
|
|
1187
1093
|
|
|
1188
|
-
def get_users_saved_shows(self, limit=None, offset=None) -> Any:
|
|
1094
|
+
async def get_users_saved_shows(self, limit=None, offset=None) -> Any:
|
|
1189
1095
|
"""
|
|
1190
1096
|
Retrieves the current user's saved shows from the Spotify API with optional pagination.
|
|
1191
1097
|
|
|
@@ -1203,14 +1109,12 @@ class SpotifyApp(APIApplication):
|
|
|
1203
1109
|
get, list, shows, spotify, user-content
|
|
1204
1110
|
"""
|
|
1205
1111
|
url = f"{self.base_url}/me/shows"
|
|
1206
|
-
query_params = {
|
|
1207
|
-
k: v for k, v in [("limit", limit), ("offset", offset)] if v is not None
|
|
1208
|
-
}
|
|
1112
|
+
query_params = {k: v for k, v in [("limit", limit), ("offset", offset)] if v is not None}
|
|
1209
1113
|
response = self._get(url, params=query_params)
|
|
1210
1114
|
response.raise_for_status()
|
|
1211
1115
|
return response.json()
|
|
1212
1116
|
|
|
1213
|
-
def check_users_saved_shows(self, ids) -> Any:
|
|
1117
|
+
async def check_users_saved_shows(self, ids) -> Any:
|
|
1214
1118
|
"""
|
|
1215
1119
|
Checks if the specified shows are saved in the current user's library.
|
|
1216
1120
|
|
|
@@ -1235,7 +1139,7 @@ class SpotifyApp(APIApplication):
|
|
|
1235
1139
|
response.raise_for_status()
|
|
1236
1140
|
return response.json()
|
|
1237
1141
|
|
|
1238
|
-
def get_users_profile(self, user_id) -> Any:
|
|
1142
|
+
async def get_users_profile(self, user_id) -> Any:
|
|
1239
1143
|
"""
|
|
1240
1144
|
Retrieves the profile information for a specific user by user ID.
|
|
1241
1145
|
|
|
@@ -1260,7 +1164,7 @@ class SpotifyApp(APIApplication):
|
|
|
1260
1164
|
response.raise_for_status()
|
|
1261
1165
|
return response.json()
|
|
1262
1166
|
|
|
1263
|
-
def get_list_users_playlists(self, user_id, limit=None, offset=None) -> Any:
|
|
1167
|
+
async def get_list_users_playlists(self, user_id, limit=None, offset=None) -> Any:
|
|
1264
1168
|
"""
|
|
1265
1169
|
Retrieves a list of playlists for a specified user.
|
|
1266
1170
|
|
|
@@ -1282,16 +1186,12 @@ class SpotifyApp(APIApplication):
|
|
|
1282
1186
|
if user_id is None:
|
|
1283
1187
|
raise ValueError("Missing required parameter 'user_id'")
|
|
1284
1188
|
url = f"{self.base_url}/users/{user_id}/playlists"
|
|
1285
|
-
query_params = {
|
|
1286
|
-
k: v for k, v in [("limit", limit), ("offset", offset)] if v is not None
|
|
1287
|
-
}
|
|
1189
|
+
query_params = {k: v for k, v in [("limit", limit), ("offset", offset)] if v is not None}
|
|
1288
1190
|
response = self._get(url, params=query_params)
|
|
1289
1191
|
response.raise_for_status()
|
|
1290
1192
|
return response.json()
|
|
1291
1193
|
|
|
1292
|
-
def create_playlist(
|
|
1293
|
-
self, user_id, name, public=None, collaborative=None, description=None
|
|
1294
|
-
) -> Any:
|
|
1194
|
+
async def create_playlist(self, user_id, name, public=None, collaborative=None, description=None) -> Any:
|
|
1295
1195
|
"""
|
|
1296
1196
|
Creates a new playlist for a specified user with optional visibility, collaboration, and description settings.
|
|
1297
1197
|
|
|
@@ -1316,12 +1216,7 @@ class SpotifyApp(APIApplication):
|
|
|
1316
1216
|
raise ValueError("Missing required parameter 'user_id'")
|
|
1317
1217
|
if name is None:
|
|
1318
1218
|
raise ValueError("Missing required parameter 'name'")
|
|
1319
|
-
request_body = {
|
|
1320
|
-
"name": name,
|
|
1321
|
-
"public": public,
|
|
1322
|
-
"collaborative": collaborative,
|
|
1323
|
-
"description": description,
|
|
1324
|
-
}
|
|
1219
|
+
request_body = {"name": name, "public": public, "collaborative": collaborative, "description": description}
|
|
1325
1220
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
1326
1221
|
url = f"{self.base_url}/users/{user_id}/playlists"
|
|
1327
1222
|
query_params = {}
|
|
@@ -1329,7 +1224,7 @@ class SpotifyApp(APIApplication):
|
|
|
1329
1224
|
response.raise_for_status()
|
|
1330
1225
|
return response.json()
|
|
1331
1226
|
|
|
1332
|
-
def follow_playlist(self, playlist_id, public=None) -> Any:
|
|
1227
|
+
async def follow_playlist(self, playlist_id, public=None) -> Any:
|
|
1333
1228
|
"""
|
|
1334
1229
|
Follows a Spotify playlist on behalf of the current user.
|
|
1335
1230
|
|
|
@@ -1349,9 +1244,7 @@ class SpotifyApp(APIApplication):
|
|
|
1349
1244
|
"""
|
|
1350
1245
|
if playlist_id is None:
|
|
1351
1246
|
raise ValueError("Missing required parameter 'playlist_id'")
|
|
1352
|
-
request_body = {
|
|
1353
|
-
"public": public,
|
|
1354
|
-
}
|
|
1247
|
+
request_body = {"public": public}
|
|
1355
1248
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
1356
1249
|
url = f"{self.base_url}/playlists/{playlist_id}/followers"
|
|
1357
1250
|
query_params = {}
|
|
@@ -1359,7 +1252,7 @@ class SpotifyApp(APIApplication):
|
|
|
1359
1252
|
response.raise_for_status()
|
|
1360
1253
|
return response.json()
|
|
1361
1254
|
|
|
1362
|
-
def unfollow_playlist(self, playlist_id) -> Any:
|
|
1255
|
+
async def unfollow_playlist(self, playlist_id) -> Any:
|
|
1363
1256
|
"""
|
|
1364
1257
|
Unfollows the specified playlist by deleting the current user's following relationship.
|
|
1365
1258
|
|
|
@@ -1384,7 +1277,7 @@ class SpotifyApp(APIApplication):
|
|
|
1384
1277
|
response.raise_for_status()
|
|
1385
1278
|
return response.json()
|
|
1386
1279
|
|
|
1387
|
-
def get_featured_playlists(self, locale=None, limit=None, offset=None) -> Any:
|
|
1280
|
+
async def get_featured_playlists(self, locale=None, limit=None, offset=None) -> Any:
|
|
1388
1281
|
"""
|
|
1389
1282
|
Retrieves a list of Spotify's featured playlists with optional localization, result limiting, and pagination.
|
|
1390
1283
|
|
|
@@ -1403,16 +1296,12 @@ class SpotifyApp(APIApplication):
|
|
|
1403
1296
|
get, list, playlists, featured, api, music
|
|
1404
1297
|
"""
|
|
1405
1298
|
url = f"{self.base_url}/browse/featured-playlists"
|
|
1406
|
-
query_params = {
|
|
1407
|
-
k: v
|
|
1408
|
-
for k, v in [("locale", locale), ("limit", limit), ("offset", offset)]
|
|
1409
|
-
if v is not None
|
|
1410
|
-
}
|
|
1299
|
+
query_params = {k: v for k, v in [("locale", locale), ("limit", limit), ("offset", offset)] if v is not None}
|
|
1411
1300
|
response = self._get(url, params=query_params)
|
|
1412
1301
|
response.raise_for_status()
|
|
1413
1302
|
return response.json()
|
|
1414
1303
|
|
|
1415
|
-
def get_categories(self, locale=None, limit=None, offset=None) -> Any:
|
|
1304
|
+
async def get_categories(self, locale=None, limit=None, offset=None) -> Any:
|
|
1416
1305
|
"""
|
|
1417
1306
|
Retrieves a list of category objects from the API with optional locale, limit, and offset filters.
|
|
1418
1307
|
|
|
@@ -1431,16 +1320,12 @@ class SpotifyApp(APIApplication):
|
|
|
1431
1320
|
get, list, categories, api
|
|
1432
1321
|
"""
|
|
1433
1322
|
url = f"{self.base_url}/browse/categories"
|
|
1434
|
-
query_params = {
|
|
1435
|
-
k: v
|
|
1436
|
-
for k, v in [("locale", locale), ("limit", limit), ("offset", offset)]
|
|
1437
|
-
if v is not None
|
|
1438
|
-
}
|
|
1323
|
+
query_params = {k: v for k, v in [("locale", locale), ("limit", limit), ("offset", offset)] if v is not None}
|
|
1439
1324
|
response = self._get(url, params=query_params)
|
|
1440
1325
|
response.raise_for_status()
|
|
1441
1326
|
return response.json()
|
|
1442
1327
|
|
|
1443
|
-
def get_a_category(self, category_id, locale=None) -> Any:
|
|
1328
|
+
async def get_a_category(self, category_id, locale=None) -> Any:
|
|
1444
1329
|
"""
|
|
1445
1330
|
Retrieve detailed information about a specific category by its ID, optionally localized to a given locale.
|
|
1446
1331
|
|
|
@@ -1466,7 +1351,7 @@ class SpotifyApp(APIApplication):
|
|
|
1466
1351
|
response.raise_for_status()
|
|
1467
1352
|
return response.json()
|
|
1468
1353
|
|
|
1469
|
-
def get_a_categories_playlists(self, category_id, limit=None, offset=None) -> Any:
|
|
1354
|
+
async def get_a_categories_playlists(self, category_id, limit=None, offset=None) -> Any:
|
|
1470
1355
|
"""
|
|
1471
1356
|
Retrieves playlists associated with a specified category from the API.
|
|
1472
1357
|
|
|
@@ -1488,14 +1373,12 @@ class SpotifyApp(APIApplication):
|
|
|
1488
1373
|
if category_id is None:
|
|
1489
1374
|
raise ValueError("Missing required parameter 'category_id'")
|
|
1490
1375
|
url = f"{self.base_url}/browse/categories/{category_id}/playlists"
|
|
1491
|
-
query_params = {
|
|
1492
|
-
k: v for k, v in [("limit", limit), ("offset", offset)] if v is not None
|
|
1493
|
-
}
|
|
1376
|
+
query_params = {k: v for k, v in [("limit", limit), ("offset", offset)] if v is not None}
|
|
1494
1377
|
response = self._get(url, params=query_params)
|
|
1495
1378
|
response.raise_for_status()
|
|
1496
1379
|
return response.json()
|
|
1497
1380
|
|
|
1498
|
-
def get_playlist_cover(self, playlist_id) -> Any:
|
|
1381
|
+
async def get_playlist_cover(self, playlist_id) -> Any:
|
|
1499
1382
|
"""
|
|
1500
1383
|
Retrieves the cover image(s) for a specified playlist by its unique ID.
|
|
1501
1384
|
|
|
@@ -1520,7 +1403,7 @@ class SpotifyApp(APIApplication):
|
|
|
1520
1403
|
response.raise_for_status()
|
|
1521
1404
|
return response.json()
|
|
1522
1405
|
|
|
1523
|
-
def get_new_releases(self, limit=None, offset=None) -> Any:
|
|
1406
|
+
async def get_new_releases(self, limit=None, offset=None) -> Any:
|
|
1524
1407
|
"""
|
|
1525
1408
|
Retrieves a list of new music releases with optional pagination parameters.
|
|
1526
1409
|
|
|
@@ -1538,14 +1421,12 @@ class SpotifyApp(APIApplication):
|
|
|
1538
1421
|
get, list, browse, music, async-job, api
|
|
1539
1422
|
"""
|
|
1540
1423
|
url = f"{self.base_url}/browse/new-releases"
|
|
1541
|
-
query_params = {
|
|
1542
|
-
k: v for k, v in [("limit", limit), ("offset", offset)] if v is not None
|
|
1543
|
-
}
|
|
1424
|
+
query_params = {k: v for k, v in [("limit", limit), ("offset", offset)] if v is not None}
|
|
1544
1425
|
response = self._get(url, params=query_params)
|
|
1545
1426
|
response.raise_for_status()
|
|
1546
1427
|
return response.json()
|
|
1547
1428
|
|
|
1548
|
-
def get_followed(self, type, after=None, limit=None) -> Any:
|
|
1429
|
+
async def get_followed(self, type, after=None, limit=None) -> Any:
|
|
1549
1430
|
"""
|
|
1550
1431
|
Retrieves the list of entities the current user is following, with support for pagination and limiting results.
|
|
1551
1432
|
|
|
@@ -1567,16 +1448,12 @@ class SpotifyApp(APIApplication):
|
|
|
1567
1448
|
if type is None:
|
|
1568
1449
|
raise ValueError("Missing required parameter 'type'")
|
|
1569
1450
|
url = f"{self.base_url}/me/following"
|
|
1570
|
-
query_params = {
|
|
1571
|
-
k: v
|
|
1572
|
-
for k, v in [("type", type), ("after", after), ("limit", limit)]
|
|
1573
|
-
if v is not None
|
|
1574
|
-
}
|
|
1451
|
+
query_params = {k: v for k, v in [("type", type), ("after", after), ("limit", limit)] if v is not None}
|
|
1575
1452
|
response = self._get(url, params=query_params)
|
|
1576
1453
|
response.raise_for_status()
|
|
1577
1454
|
return response.json()
|
|
1578
1455
|
|
|
1579
|
-
def follow_artists_users(self, type, ids) -> Any:
|
|
1456
|
+
async def follow_artists_users(self, type, ids) -> Any:
|
|
1580
1457
|
"""
|
|
1581
1458
|
Follows one or more artists or users on behalf of the current user.
|
|
1582
1459
|
|
|
@@ -1598,19 +1475,15 @@ class SpotifyApp(APIApplication):
|
|
|
1598
1475
|
raise ValueError("Missing required parameter 'type'")
|
|
1599
1476
|
if ids is None:
|
|
1600
1477
|
raise ValueError("Missing required parameter 'ids'")
|
|
1601
|
-
request_body = {
|
|
1602
|
-
"ids": ids,
|
|
1603
|
-
}
|
|
1478
|
+
request_body = {"ids": ids}
|
|
1604
1479
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
1605
1480
|
url = f"{self.base_url}/me/following"
|
|
1606
|
-
query_params = {
|
|
1607
|
-
k: v for k, v in [("type", type), ("ids", ids)] if v is not None
|
|
1608
|
-
}
|
|
1481
|
+
query_params = {k: v for k, v in [("type", type), ("ids", ids)] if v is not None}
|
|
1609
1482
|
response = self._put(url, data=request_body, params=query_params)
|
|
1610
1483
|
response.raise_for_status()
|
|
1611
1484
|
return response.json()
|
|
1612
1485
|
|
|
1613
|
-
def check_current_user_follows(self, type, ids) -> Any:
|
|
1486
|
+
async def check_current_user_follows(self, type, ids) -> Any:
|
|
1614
1487
|
"""
|
|
1615
1488
|
Check if the current user follows specific Spotify users or artists.
|
|
1616
1489
|
|
|
@@ -1633,14 +1506,12 @@ class SpotifyApp(APIApplication):
|
|
|
1633
1506
|
if ids is None:
|
|
1634
1507
|
raise ValueError("Missing required parameter 'ids'")
|
|
1635
1508
|
url = f"{self.base_url}/me/following/contains"
|
|
1636
|
-
query_params = {
|
|
1637
|
-
k: v for k, v in [("type", type), ("ids", ids)] if v is not None
|
|
1638
|
-
}
|
|
1509
|
+
query_params = {k: v for k, v in [("type", type), ("ids", ids)] if v is not None}
|
|
1639
1510
|
response = self._get(url, params=query_params)
|
|
1640
1511
|
response.raise_for_status()
|
|
1641
1512
|
return response.json()
|
|
1642
1513
|
|
|
1643
|
-
def check_if_user_follows_playlist(self, playlist_id, ids) -> Any:
|
|
1514
|
+
async def check_if_user_follows_playlist(self, playlist_id, ids) -> Any:
|
|
1644
1515
|
"""
|
|
1645
1516
|
Checks if one or more users follow a specified playlist.
|
|
1646
1517
|
|
|
@@ -1668,7 +1539,7 @@ class SpotifyApp(APIApplication):
|
|
|
1668
1539
|
response.raise_for_status()
|
|
1669
1540
|
return response.json()
|
|
1670
1541
|
|
|
1671
|
-
def get_several_audio_features(self, ids) -> Any:
|
|
1542
|
+
async def get_several_audio_features(self, ids) -> Any:
|
|
1672
1543
|
"""
|
|
1673
1544
|
Retrieves audio feature information for multiple tracks using their IDs.
|
|
1674
1545
|
|
|
@@ -1693,7 +1564,7 @@ class SpotifyApp(APIApplication):
|
|
|
1693
1564
|
response.raise_for_status()
|
|
1694
1565
|
return response.json()
|
|
1695
1566
|
|
|
1696
|
-
def get_audio_features(self, id) -> Any:
|
|
1567
|
+
async def get_audio_features(self, id) -> Any:
|
|
1697
1568
|
"""
|
|
1698
1569
|
Retrieves audio feature information for a given identifier from the API.
|
|
1699
1570
|
|
|
@@ -1718,7 +1589,7 @@ class SpotifyApp(APIApplication):
|
|
|
1718
1589
|
response.raise_for_status()
|
|
1719
1590
|
return response.json()
|
|
1720
1591
|
|
|
1721
|
-
def get_audio_analysis(self, id) -> Any:
|
|
1592
|
+
async def get_audio_analysis(self, id) -> Any:
|
|
1722
1593
|
"""
|
|
1723
1594
|
Retrieves the audio analysis data for a specified audio ID from the API.
|
|
1724
1595
|
|
|
@@ -1743,7 +1614,7 @@ class SpotifyApp(APIApplication):
|
|
|
1743
1614
|
response.raise_for_status()
|
|
1744
1615
|
return response.json()
|
|
1745
1616
|
|
|
1746
|
-
def get_recommendations(
|
|
1617
|
+
async def get_recommendations(
|
|
1747
1618
|
self,
|
|
1748
1619
|
limit=None,
|
|
1749
1620
|
market=None,
|
|
@@ -1913,9 +1784,7 @@ class SpotifyApp(APIApplication):
|
|
|
1913
1784
|
response.raise_for_status()
|
|
1914
1785
|
return response.json()
|
|
1915
1786
|
|
|
1916
|
-
def get_recommendation_genres(
|
|
1917
|
-
self,
|
|
1918
|
-
) -> Any:
|
|
1787
|
+
async def get_recommendation_genres(self) -> Any:
|
|
1919
1788
|
"""
|
|
1920
1789
|
Retrieves a list of available genre seeds for recommendations from the remote API.
|
|
1921
1790
|
|
|
@@ -1937,9 +1806,7 @@ class SpotifyApp(APIApplication):
|
|
|
1937
1806
|
response.raise_for_status()
|
|
1938
1807
|
return response.json()
|
|
1939
1808
|
|
|
1940
|
-
def get_information_about_the_users_current_playback(
|
|
1941
|
-
self, market=None, additional_types=None
|
|
1942
|
-
) -> Any:
|
|
1809
|
+
async def get_information_about_the_users_current_playback(self, market=None, additional_types=None) -> Any:
|
|
1943
1810
|
"""
|
|
1944
1811
|
Retrieves information about the user's current playback state from the music service.
|
|
1945
1812
|
|
|
@@ -1957,16 +1824,12 @@ class SpotifyApp(APIApplication):
|
|
|
1957
1824
|
get, playback, user, status, api
|
|
1958
1825
|
"""
|
|
1959
1826
|
url = f"{self.base_url}/me/player"
|
|
1960
|
-
query_params = {
|
|
1961
|
-
k: v
|
|
1962
|
-
for k, v in [("market", market), ("additional_types", additional_types)]
|
|
1963
|
-
if v is not None
|
|
1964
|
-
}
|
|
1827
|
+
query_params = {k: v for k, v in [("market", market), ("additional_types", additional_types)] if v is not None}
|
|
1965
1828
|
response = self._get(url, params=query_params)
|
|
1966
1829
|
response.raise_for_status()
|
|
1967
1830
|
return response.json()
|
|
1968
1831
|
|
|
1969
|
-
def transfer_a_users_playback(self, device_ids, play=None) -> Any:
|
|
1832
|
+
async def transfer_a_users_playback(self, device_ids, play=None) -> Any:
|
|
1970
1833
|
"""
|
|
1971
1834
|
Transfers the playback of a user's current session to one or more specified devices.
|
|
1972
1835
|
|
|
@@ -1986,10 +1849,7 @@ class SpotifyApp(APIApplication):
|
|
|
1986
1849
|
"""
|
|
1987
1850
|
if device_ids is None:
|
|
1988
1851
|
raise ValueError("Missing required parameter 'device_ids'")
|
|
1989
|
-
request_body = {
|
|
1990
|
-
"device_ids": device_ids,
|
|
1991
|
-
"play": play,
|
|
1992
|
-
}
|
|
1852
|
+
request_body = {"device_ids": device_ids, "play": play}
|
|
1993
1853
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
1994
1854
|
url = f"{self.base_url}/me/player"
|
|
1995
1855
|
query_params = {}
|
|
@@ -1997,9 +1857,7 @@ class SpotifyApp(APIApplication):
|
|
|
1997
1857
|
response.raise_for_status()
|
|
1998
1858
|
return response.json()
|
|
1999
1859
|
|
|
2000
|
-
def get_a_users_available_devices(
|
|
2001
|
-
self,
|
|
2002
|
-
) -> Any:
|
|
1860
|
+
async def get_a_users_available_devices(self) -> Any:
|
|
2003
1861
|
"""
|
|
2004
1862
|
Retrieves the list of devices available to the current user for playback control.
|
|
2005
1863
|
|
|
@@ -2021,9 +1879,7 @@ class SpotifyApp(APIApplication):
|
|
|
2021
1879
|
response.raise_for_status()
|
|
2022
1880
|
return response.json()
|
|
2023
1881
|
|
|
2024
|
-
def get_the_users_currently_playing_track(
|
|
2025
|
-
self, market=None, additional_types=None
|
|
2026
|
-
) -> Any:
|
|
1882
|
+
async def get_the_users_currently_playing_track(self, market=None, additional_types=None) -> Any:
|
|
2027
1883
|
"""
|
|
2028
1884
|
Retrieves information about the track currently being played by the user.
|
|
2029
1885
|
|
|
@@ -2041,18 +1897,12 @@ class SpotifyApp(APIApplication):
|
|
|
2041
1897
|
get, track, player, user, async_job
|
|
2042
1898
|
"""
|
|
2043
1899
|
url = f"{self.base_url}/me/player/currently-playing"
|
|
2044
|
-
query_params = {
|
|
2045
|
-
k: v
|
|
2046
|
-
for k, v in [("market", market), ("additional_types", additional_types)]
|
|
2047
|
-
if v is not None
|
|
2048
|
-
}
|
|
1900
|
+
query_params = {k: v for k, v in [("market", market), ("additional_types", additional_types)] if v is not None}
|
|
2049
1901
|
response = self._get(url, params=query_params)
|
|
2050
1902
|
response.raise_for_status()
|
|
2051
1903
|
return response.json()
|
|
2052
1904
|
|
|
2053
|
-
def start_a_users_playback(
|
|
2054
|
-
self, device_id=None, context_uri=None, uris=None, offset=None, position_ms=None
|
|
2055
|
-
) -> Any:
|
|
1905
|
+
async def start_a_users_playback(self, device_id=None, context_uri=None, uris=None, offset=None, position_ms=None) -> Any:
|
|
2056
1906
|
"""
|
|
2057
1907
|
Starts or resumes playback of a user's Spotify player on the specified device, context, or track list.
|
|
2058
1908
|
|
|
@@ -2072,12 +1922,7 @@ class SpotifyApp(APIApplication):
|
|
|
2072
1922
|
Tags:
|
|
2073
1923
|
start, playback, ai, management, async_job
|
|
2074
1924
|
"""
|
|
2075
|
-
request_body = {
|
|
2076
|
-
"context_uri": context_uri,
|
|
2077
|
-
"uris": uris,
|
|
2078
|
-
"offset": offset,
|
|
2079
|
-
"position_ms": position_ms,
|
|
2080
|
-
}
|
|
1925
|
+
request_body = {"context_uri": context_uri, "uris": uris, "offset": offset, "position_ms": position_ms}
|
|
2081
1926
|
request_body = {k: v for k, v in request_body.items() if v is not None}
|
|
2082
1927
|
url = f"{self.base_url}/me/player/play"
|
|
2083
1928
|
query_params = {k: v for k, v in [("device_id", device_id)] if v is not None}
|
|
@@ -2085,7 +1930,7 @@ class SpotifyApp(APIApplication):
|
|
|
2085
1930
|
response.raise_for_status()
|
|
2086
1931
|
return response.json()
|
|
2087
1932
|
|
|
2088
|
-
def pause_a_users_playback(self, device_id=None) -> Any:
|
|
1933
|
+
async def pause_a_users_playback(self, device_id=None) -> Any:
|
|
2089
1934
|
"""
|
|
2090
1935
|
Pauses the current playback for the authenticated user.
|
|
2091
1936
|
|
|
@@ -2107,7 +1952,7 @@ class SpotifyApp(APIApplication):
|
|
|
2107
1952
|
response.raise_for_status()
|
|
2108
1953
|
return response.json()
|
|
2109
1954
|
|
|
2110
|
-
def skip_users_playback_to_next_track(self, device_id=None) -> Any:
|
|
1955
|
+
async def skip_users_playback_to_next_track(self, device_id=None) -> Any:
|
|
2111
1956
|
"""
|
|
2112
1957
|
Skips the user's playback to the next track on the current or specified device.
|
|
2113
1958
|
|
|
@@ -2129,7 +1974,7 @@ class SpotifyApp(APIApplication):
|
|
|
2129
1974
|
response.raise_for_status()
|
|
2130
1975
|
return response.json()
|
|
2131
1976
|
|
|
2132
|
-
def skip_users_playback_to_previous_track(self, device_id=None) -> Any:
|
|
1977
|
+
async def skip_users_playback_to_previous_track(self, device_id=None) -> Any:
|
|
2133
1978
|
"""
|
|
2134
1979
|
Skips the user's playback to the previous track on the active or specified device.
|
|
2135
1980
|
|
|
@@ -2151,9 +1996,7 @@ class SpotifyApp(APIApplication):
|
|
|
2151
1996
|
response.raise_for_status()
|
|
2152
1997
|
return response.json()
|
|
2153
1998
|
|
|
2154
|
-
def seek_to_position_in_currently_playing_track(
|
|
2155
|
-
self, position_ms, device_id=None
|
|
2156
|
-
) -> Any:
|
|
1999
|
+
async def seek_to_position_in_currently_playing_track(self, position_ms, device_id=None) -> Any:
|
|
2157
2000
|
"""
|
|
2158
2001
|
Seeks to the specified position in the currently playing track for the user.
|
|
2159
2002
|
|
|
@@ -2174,16 +2017,12 @@ class SpotifyApp(APIApplication):
|
|
|
2174
2017
|
if position_ms is None:
|
|
2175
2018
|
raise ValueError("Missing required parameter 'position_ms'")
|
|
2176
2019
|
url = f"{self.base_url}/me/player/seek"
|
|
2177
|
-
query_params = {
|
|
2178
|
-
k: v
|
|
2179
|
-
for k, v in [("position_ms", position_ms), ("device_id", device_id)]
|
|
2180
|
-
if v is not None
|
|
2181
|
-
}
|
|
2020
|
+
query_params = {k: v for k, v in [("position_ms", position_ms), ("device_id", device_id)] if v is not None}
|
|
2182
2021
|
response = self._put(url, data={}, params=query_params)
|
|
2183
2022
|
response.raise_for_status()
|
|
2184
2023
|
return response.json()
|
|
2185
2024
|
|
|
2186
|
-
def set_repeat_mode_on_users_playback(self, state, device_id=None) -> Any:
|
|
2025
|
+
async def set_repeat_mode_on_users_playback(self, state, device_id=None) -> Any:
|
|
2187
2026
|
"""
|
|
2188
2027
|
Sets the repeat mode for the current user's playback on Spotify, optionally targeting a specific device.
|
|
2189
2028
|
|
|
@@ -2204,16 +2043,12 @@ class SpotifyApp(APIApplication):
|
|
|
2204
2043
|
if state is None:
|
|
2205
2044
|
raise ValueError("Missing required parameter 'state'")
|
|
2206
2045
|
url = f"{self.base_url}/me/player/repeat"
|
|
2207
|
-
query_params = {
|
|
2208
|
-
k: v
|
|
2209
|
-
for k, v in [("state", state), ("device_id", device_id)]
|
|
2210
|
-
if v is not None
|
|
2211
|
-
}
|
|
2046
|
+
query_params = {k: v for k, v in [("state", state), ("device_id", device_id)] if v is not None}
|
|
2212
2047
|
response = self._put(url, data={}, params=query_params)
|
|
2213
2048
|
response.raise_for_status()
|
|
2214
2049
|
return response.json()
|
|
2215
2050
|
|
|
2216
|
-
def set_volume_for_users_playback(self, volume_percent, device_id=None) -> Any:
|
|
2051
|
+
async def set_volume_for_users_playback(self, volume_percent, device_id=None) -> Any:
|
|
2217
2052
|
"""
|
|
2218
2053
|
Set the playback volume for the current user's active device.
|
|
2219
2054
|
|
|
@@ -2234,16 +2069,12 @@ class SpotifyApp(APIApplication):
|
|
|
2234
2069
|
if volume_percent is None:
|
|
2235
2070
|
raise ValueError("Missing required parameter 'volume_percent'")
|
|
2236
2071
|
url = f"{self.base_url}/me/player/volume"
|
|
2237
|
-
query_params = {
|
|
2238
|
-
k: v
|
|
2239
|
-
for k, v in [("volume_percent", volume_percent), ("device_id", device_id)]
|
|
2240
|
-
if v is not None
|
|
2241
|
-
}
|
|
2072
|
+
query_params = {k: v for k, v in [("volume_percent", volume_percent), ("device_id", device_id)] if v is not None}
|
|
2242
2073
|
response = self._put(url, data={}, params=query_params)
|
|
2243
2074
|
response.raise_for_status()
|
|
2244
2075
|
return response.json()
|
|
2245
2076
|
|
|
2246
|
-
def toggle_shuffle_for_users_playback(self, state, device_id=None) -> Any:
|
|
2077
|
+
async def toggle_shuffle_for_users_playback(self, state, device_id=None) -> Any:
|
|
2247
2078
|
"""
|
|
2248
2079
|
Toggles the shuffle state for the user's playback on the specified device.
|
|
2249
2080
|
|
|
@@ -2264,16 +2095,12 @@ class SpotifyApp(APIApplication):
|
|
|
2264
2095
|
if state is None:
|
|
2265
2096
|
raise ValueError("Missing required parameter 'state'")
|
|
2266
2097
|
url = f"{self.base_url}/me/player/shuffle"
|
|
2267
|
-
query_params = {
|
|
2268
|
-
k: v
|
|
2269
|
-
for k, v in [("state", state), ("device_id", device_id)]
|
|
2270
|
-
if v is not None
|
|
2271
|
-
}
|
|
2098
|
+
query_params = {k: v for k, v in [("state", state), ("device_id", device_id)] if v is not None}
|
|
2272
2099
|
response = self._put(url, data={}, params=query_params)
|
|
2273
2100
|
response.raise_for_status()
|
|
2274
2101
|
return response.json()
|
|
2275
2102
|
|
|
2276
|
-
def get_recently_played(self, limit=None, after=None, before=None) -> Any:
|
|
2103
|
+
async def get_recently_played(self, limit=None, after=None, before=None) -> Any:
|
|
2277
2104
|
"""
|
|
2278
2105
|
Retrieves the current user's recently played tracks from the Spotify API, optionally filtered by time or limited in count.
|
|
2279
2106
|
|
|
@@ -2292,18 +2119,12 @@ class SpotifyApp(APIApplication):
|
|
|
2292
2119
|
get, list, spotify-api, user-library, recently-played
|
|
2293
2120
|
"""
|
|
2294
2121
|
url = f"{self.base_url}/me/player/recently-played"
|
|
2295
|
-
query_params = {
|
|
2296
|
-
k: v
|
|
2297
|
-
for k, v in [("limit", limit), ("after", after), ("before", before)]
|
|
2298
|
-
if v is not None
|
|
2299
|
-
}
|
|
2122
|
+
query_params = {k: v for k, v in [("limit", limit), ("after", after), ("before", before)] if v is not None}
|
|
2300
2123
|
response = self._get(url, params=query_params)
|
|
2301
2124
|
response.raise_for_status()
|
|
2302
2125
|
return response.json()
|
|
2303
2126
|
|
|
2304
|
-
def get_queue(
|
|
2305
|
-
self,
|
|
2306
|
-
) -> Any:
|
|
2127
|
+
async def get_queue(self) -> Any:
|
|
2307
2128
|
"""
|
|
2308
2129
|
Retrieves the current playback queue for the user from the music player API.
|
|
2309
2130
|
|
|
@@ -2325,7 +2146,7 @@ class SpotifyApp(APIApplication):
|
|
|
2325
2146
|
response.raise_for_status()
|
|
2326
2147
|
return response.json()
|
|
2327
2148
|
|
|
2328
|
-
def add_to_queue(self, uri, device_id=None) -> Any:
|
|
2149
|
+
async def add_to_queue(self, uri, device_id=None) -> Any:
|
|
2329
2150
|
"""
|
|
2330
2151
|
Adds an item to the user's playback queue on the specified device using its URI.
|
|
2331
2152
|
|
|
@@ -2346,16 +2167,12 @@ class SpotifyApp(APIApplication):
|
|
|
2346
2167
|
if uri is None:
|
|
2347
2168
|
raise ValueError("Missing required parameter 'uri'")
|
|
2348
2169
|
url = f"{self.base_url}/me/player/queue"
|
|
2349
|
-
query_params = {
|
|
2350
|
-
k: v for k, v in [("uri", uri), ("device_id", device_id)] if v is not None
|
|
2351
|
-
}
|
|
2170
|
+
query_params = {k: v for k, v in [("uri", uri), ("device_id", device_id)] if v is not None}
|
|
2352
2171
|
response = self._post(url, data={}, params=query_params)
|
|
2353
2172
|
response.raise_for_status()
|
|
2354
2173
|
return response.json()
|
|
2355
2174
|
|
|
2356
|
-
def get_available_markets(
|
|
2357
|
-
self,
|
|
2358
|
-
) -> Any:
|
|
2175
|
+
async def get_available_markets(self) -> Any:
|
|
2359
2176
|
"""
|
|
2360
2177
|
Retrieves a list of available markets from the API endpoint.
|
|
2361
2178
|
|
|
@@ -2377,7 +2194,7 @@ class SpotifyApp(APIApplication):
|
|
|
2377
2194
|
response.raise_for_status()
|
|
2378
2195
|
return response.json()
|
|
2379
2196
|
|
|
2380
|
-
def get_users_top_artists(self, time_range=None, limit=None, offset=None) -> Any:
|
|
2197
|
+
async def get_users_top_artists(self, time_range=None, limit=None, offset=None) -> Any:
|
|
2381
2198
|
"""
|
|
2382
2199
|
Retrieves the current user's top artists from the API, supporting optional filtering by time range, result limit, and pagination offset.
|
|
2383
2200
|
|
|
@@ -2396,20 +2213,12 @@ class SpotifyApp(APIApplication):
|
|
|
2396
2213
|
get, list, artists, user, ai, batch
|
|
2397
2214
|
"""
|
|
2398
2215
|
url = f"{self.base_url}/me/top/artists"
|
|
2399
|
-
query_params = {
|
|
2400
|
-
k: v
|
|
2401
|
-
for k, v in [
|
|
2402
|
-
("time_range", time_range),
|
|
2403
|
-
("limit", limit),
|
|
2404
|
-
("offset", offset),
|
|
2405
|
-
]
|
|
2406
|
-
if v is not None
|
|
2407
|
-
}
|
|
2216
|
+
query_params = {k: v for k, v in [("time_range", time_range), ("limit", limit), ("offset", offset)] if v is not None}
|
|
2408
2217
|
response = self._get(url, params=query_params)
|
|
2409
2218
|
response.raise_for_status()
|
|
2410
2219
|
return response.json()
|
|
2411
2220
|
|
|
2412
|
-
def get_users_top_tracks(self, time_range=None, limit=None, offset=None) -> Any:
|
|
2221
|
+
async def get_users_top_tracks(self, time_range=None, limit=None, offset=None) -> Any:
|
|
2413
2222
|
"""
|
|
2414
2223
|
Retrieves the current user's top tracks from the service within an optional time range, with pagination support.
|
|
2415
2224
|
|
|
@@ -2428,15 +2237,7 @@ class SpotifyApp(APIApplication):
|
|
|
2428
2237
|
get, list, user, tracks, ai
|
|
2429
2238
|
"""
|
|
2430
2239
|
url = f"{self.base_url}/me/top/tracks"
|
|
2431
|
-
query_params = {
|
|
2432
|
-
k: v
|
|
2433
|
-
for k, v in [
|
|
2434
|
-
("time_range", time_range),
|
|
2435
|
-
("limit", limit),
|
|
2436
|
-
("offset", offset),
|
|
2437
|
-
]
|
|
2438
|
-
if v is not None
|
|
2439
|
-
}
|
|
2240
|
+
query_params = {k: v for k, v in [("time_range", time_range), ("limit", limit), ("offset", offset)] if v is not None}
|
|
2440
2241
|
response = self._get(url, params=query_params)
|
|
2441
2242
|
response.raise_for_status()
|
|
2442
2243
|
return response.json()
|