diff --git a/__pycache__/_canvas.cpython-310.pyc b/__pycache__/_canvas.cpython-310.pyc new file mode 100644 index 0000000..cce70f1 Binary files /dev/null and b/__pycache__/_canvas.cpython-310.pyc differ diff --git a/code b/code index 7cf5f72..f05bb08 100644 --- a/code +++ b/code @@ -1 +1 @@ -AQDU_0NUgm9-EMYMDBYUTnBApWyYO6m4EDUExbHzjM_CcVkoGptsE69uePQ7ejw5NooRTCpQqIU7ZfOTfE5Nx8zj6amQBFRkgv7vMa5ViqCbH_hqos--D6mj-eG3jqW-sf-Oyq0vmPUaam6R0fB--ghWzM8EG8SRVQBGTnEN-OLf1PBX5I1sOS22GXrMud5BcFziAiYQxHn_GcnPXEyXigkHAsk60PFiWDUwW6fLdUKW2FtyJnnYH01al28eex1QEeqr2gg8e5ht9XGKfQej0ciFM62ESwIbpDZDi6bWdSk \ No newline at end of file +AQCZgUjpd41T5OxjgCR08o-WIKMoJVOkKQnnXWWyCMPfr9AF8OOauNn9wYPX4sFKpWxINeHmeimsNw7c2e1HVCu038drk_o9K-0rdgtG7QlQc02ENsbkJC5tjr3M40-oxdmoz203NA_qj1J_DyQBx6TA-FbHS8WXiDTIn9pB3IpVNCSCf8kubjn6MOvDU8w6uXyjwCDLUBN5ptfARe4yFEXKNlgxgQcbAsj0DPpS4owhvYbo-tAwINmyJPuO61-TUbQ6U5qWLN7A1UkhbAkX0kJfFd3WnCsGiDpQmgLmmb8 \ No newline at end of file diff --git a/protos/__pycache__/canvas_pb2.cpython-310.pyc b/protos/__pycache__/canvas_pb2.cpython-310.pyc index b6a642e..2ffa0d7 100755 Binary files a/protos/__pycache__/canvas_pb2.cpython-310.pyc and b/protos/__pycache__/canvas_pb2.cpython-310.pyc differ diff --git a/spotifycontroller.py b/spotifycontroller.py index 8017a60..a5222f1 100644 --- a/spotifycontroller.py +++ b/spotifycontroller.py @@ -89,10 +89,13 @@ def callback(): def appdata(): global access_token stime = time.time() - user_headers = { - "Authorization": "Bearer " + access_token, - "Content-Type": "application/json" - } + try: + user_headers = { + "Authorization": "Bearer " + access_token, + "Content-Type": "application/json" + } + except NameError: + return { 'reload': True } currently_playing = requests.get("https://api.spotify.com/v1/me/player/currently-playing", headers=user_headers) if currently_playing.content: @@ -100,8 +103,7 @@ def appdata(): print("QUICK" + str(time.time() - stime)) return { 'progress_ms': currently_playing.json()["progress_ms"], } - elif currently_playing.json()["is_playing"] is True and currently_playing.json()["item"]["id"] != request.args.get('id'): - + elif currently_playing.json()["is_playing"] is True and currently_playing.json()["item"]["id"] != request.args.get('id'): print("FULL" + str(time.time() - stime)) return { 'id': currently_playing.json()["item"]["id"], 'name': currently_playing.json()["item"]["name"], diff --git a/templates/webapp.html b/templates/webapp.html index e099787..0468739 100644 --- a/templates/webapp.html +++ b/templates/webapp.html @@ -5,12 +5,12 @@ SpotifyJS +