mirror of
https://github.com/Xevion/spotify-explicit.git
synced 2025-12-06 01:16:25 -06:00
initialization
This commit is contained in:
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
__pycache__/**
|
||||||
|
tracks/**
|
||||||
|
cache_xevioni/**
|
||||||
|
.cache-*
|
||||||
9
auth.py
Normal file
9
auth.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
username = "xevioni"
|
||||||
|
client_id = "20cc828edc7140d88e1c8b0c08ed1672"
|
||||||
|
client_secret = "519fb97148a14952859ca3454b886cf9"
|
||||||
|
redirect_uri = "http://localhost:8888/callback"
|
||||||
|
scope = ' '.join([
|
||||||
|
'user-library-read',
|
||||||
|
'user-read-recently-played',
|
||||||
|
'user-top-read'
|
||||||
|
])
|
||||||
25
pull.py
Normal file
25
pull.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import auth
|
||||||
|
import json
|
||||||
|
import pprint
|
||||||
|
import spotipy
|
||||||
|
import spotipy.util as util
|
||||||
|
|
||||||
|
# Get Authorization
|
||||||
|
token = util.prompt_for_user_token(
|
||||||
|
username=auth.username,
|
||||||
|
scope=auth.scope,
|
||||||
|
client_id=auth.client_id,
|
||||||
|
client_secret=auth.client_secret,
|
||||||
|
redirect_uri=auth.redirect_uri
|
||||||
|
)
|
||||||
|
sp = spotipy.Spotify(auth=token)
|
||||||
|
saved_response = sp.current_user_saved_tracks(limit=50, offset=100000)
|
||||||
|
# saved_response = json.load(open('saved_tracks.json', 'r'))
|
||||||
|
json.dump(saved_response, open('saved_tracks.json', 'w+'))
|
||||||
|
pprint.pprint(saved_response)
|
||||||
|
# for track in saved_response['items']:
|
||||||
|
# print('{} by {}'.format(
|
||||||
|
# track['track']['name'],
|
||||||
|
# ' & '.join(artist['name'] for artist in track['track']['artists'])
|
||||||
|
# ))
|
||||||
|
|
||||||
Reference in New Issue
Block a user