From b2f3c43d0f64ffa467f3385f243f54cb8dccd798 Mon Sep 17 00:00:00 2001 From: ritiek Date: Thu, 11 Jan 2018 22:32:32 +0530 Subject: [PATCH] Remove unused imports and fix token regeneration --- spotdl.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spotdl.py b/spotdl.py index d47ef67..09e945e 100755 --- a/spotdl.py +++ b/spotdl.py @@ -10,12 +10,10 @@ from core import spotify_tools from core import youtube_tools from slugify import slugify import spotipy -import pafy import urllib.request import os import sys import time -import sys import platform import pprint @@ -85,8 +83,7 @@ def grab_list(text_file): # refresh token when it expires log.debug('Token expired, generating new one and authorizing') new_token = spotify_tools.generate_token() - global spotify - spotify = spotipy.Spotify(auth=new_token) + spotify_tools.spotify = spotipy.Spotify(auth=new_token) grab_single(raw_song, number=number) # detect network problems except (urllib.request.URLError, TypeError, IOError):