mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-10-12 01:10:45 +00:00
* test_improvements - Add __init__.py files to tests dirs so you can run all tests * test_improvements - added helpers file, restructured tests to work without previous data and to be grouped with api type * http_retries - Implement Retry for all requests * Readme - Update README with contributing info * PR Feedback - Added CONTRIBUTING.md, fixed README, fixed test
This commit is contained in:
9 files changed
+382
-328
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import base64
|
||||
import requests
|
||||
|
||||
|
||||
def get_spotify_playlist(spotify_object, playlist_name, username):
|
||||
playlists = spotify_object.user_playlists(username)
|
||||
while playlists:
|
||||
for item in playlists['items']:
|
||||
if item['name'] == playlist_name:
|
||||
return item
|
||||
playlists = spotify_object.next(playlists)
|
||||
|
||||
|
||||
def create_spotify_playlist(spotify_object, playlist_name, username):
|
||||
return spotify_object.user_playlist_create(username, playlist_name)
|
||||
|
||||
|
||||
def get_as_base64(url):
|
||||
return base64.b64encode(requests.get(url).content).decode("utf-8")
|
||||
Reference in new issue
Block a user