Fix check_exists() from giving prompts on non-existent files

This commit is contained in:
Ritiek
2017-06-16 02:06:08 +05:30
parent be088f6dc0
commit 74511cf596
2 changed files with 40 additions and 36 deletions

View File

@@ -1,6 +1,7 @@
import argparse
import sys
import os
from slugify import slugify
import spotipy.oauth2 as oauth2
def input_link(links):
@@ -56,6 +57,11 @@ def is_spotify(raw_song):
else:
return False
def generate_filename(title):
raw_title = title.replace(' ', '_')
filename = slugify(raw_title, ok='-_()[]{}', lower=False)
return fix_encoding(filename)
def generate_token():
# Please respect this user token :)
creds = oauth2.SpotifyClientCredentials(