Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions ByeAds.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import spotipy
import spotipy.util as util
from pynput.keyboard import Key, Controller

import json
keyboard = Controller()


Expand Down Expand Up @@ -37,13 +37,15 @@ def restartSpotify():
closeSpotify()
openSpotify()
playSpotify()


spotifyUsername = "#EnterUsernameHere"
spotifyClientID = "#EnterClientIDHere"
spotifyClientSecret = "#EnterClientSecretHere"
spotifyAccessScope = "user-read-currently-playing user-modify-playback-state"
spotifyRedirectURI = "http://google.com/"
#load options.json
with open('options.json', 'r') as f:
options = json.load(f)
#Set variables equal to options.json equivalent
spotifyUsername = options["spotifyUsername"]
spotifyClientID = options["spotifyClientID"]
spotifyClientSecret = options["spotifyClientSecret"]
spotifyAccessScope = options["spotifyAccessScope"]
spotifyRedirectURI = options["spotifyRedirectURI"]

def setupSpotifyObject(username, scope, clientID, clientSecret, redirectURI):
token = util.prompt_for_user_token(username, scope, clientID, clientSecret, redirectURI)
Expand Down
5 changes: 5 additions & 0 deletions options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{"spotifyUsername": "#EnterUsernameHere",
"spotifyClientID": "#EnterClientIDHere",
"spotifyClientSecret": "#EnterClientSecretHere",
"spotifyAccessScope": "user-read-currently-playing user-modify-playback-state",
"spotifyRedirectURI": "http://google.com/"}