yes.
This commit is contained in:
parent
c660d2b67a
commit
b0de5cca7c
1 changed files with 10 additions and 7 deletions
17
main.py
17
main.py
|
@ -1,23 +1,26 @@
|
||||||
import sys
|
import sys
|
||||||
import spotipy
|
import spotipy
|
||||||
import spotipy.util as util
|
import spotipy.util as util
|
||||||
|
import config as cfg
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
import configparser
|
||||||
|
configParser = configparser.RawConfigParser()
|
||||||
|
configFilePath = 'config.conf'
|
||||||
|
|
||||||
|
|
||||||
|
client_id = cfg.client_id
|
||||||
|
client_secret = cfg.client_secret
|
||||||
|
redirect_uri = cfg.redirect_uri
|
||||||
|
username = cfg.username
|
||||||
|
|
||||||
scope = 'user-read-currently-playing'
|
scope = 'user-read-currently-playing'
|
||||||
|
|
||||||
if len(sys.argv) > 1:
|
|
||||||
username = sys.argv[1]
|
|
||||||
else:
|
|
||||||
print("Usage: %s username" % (sys.argv[0],))
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
token = util.prompt_for_user_token(username, scope)
|
|
||||||
|
token = util.prompt_for_user_token(username, scope, client_id, client_secret, redirect_uri)
|
||||||
|
|
||||||
if token:
|
if token:
|
||||||
sp = spotipy.Spotify(auth=token)
|
sp = spotipy.Spotify(auth=token)
|
||||||
|
|
Loading…
Reference in a new issue