mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
Remove unused imports and fix token regeneration
This commit is contained in:
@@ -10,12 +10,10 @@ from core import spotify_tools
|
|||||||
from core import youtube_tools
|
from core import youtube_tools
|
||||||
from slugify import slugify
|
from slugify import slugify
|
||||||
import spotipy
|
import spotipy
|
||||||
import pafy
|
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import sys
|
|
||||||
import platform
|
import platform
|
||||||
import pprint
|
import pprint
|
||||||
|
|
||||||
@@ -85,8 +83,7 @@ def grab_list(text_file):
|
|||||||
# refresh token when it expires
|
# refresh token when it expires
|
||||||
log.debug('Token expired, generating new one and authorizing')
|
log.debug('Token expired, generating new one and authorizing')
|
||||||
new_token = spotify_tools.generate_token()
|
new_token = spotify_tools.generate_token()
|
||||||
global spotify
|
spotify_tools.spotify = spotipy.Spotify(auth=new_token)
|
||||||
spotify = spotipy.Spotify(auth=new_token)
|
|
||||||
grab_single(raw_song, number=number)
|
grab_single(raw_song, number=number)
|
||||||
# detect network problems
|
# detect network problems
|
||||||
except (urllib.request.URLError, TypeError, IOError):
|
except (urllib.request.URLError, TypeError, IOError):
|
||||||
|
|||||||
Reference in New Issue
Block a user