Remove unused imports and fix token regeneration

This commit is contained in:
ritiek
2018-01-11 22:32:32 +05:30
parent fce2a1abcd
commit b2f3c43d0f

View File

@@ -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):