mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
Setup coloredlogs
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
from logzero import logger as log
|
||||
import os
|
||||
import sys
|
||||
import math
|
||||
import urllib.request
|
||||
|
||||
import threading
|
||||
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
try:
|
||||
import winreg
|
||||
@@ -15,8 +16,8 @@ except ImportError:
|
||||
try:
|
||||
from slugify import SLUG_OK, slugify
|
||||
except ImportError:
|
||||
log.error("Oops! `unicode-slugify` was not found.")
|
||||
log.info("Please remove any other slugify library and install `unicode-slugify`")
|
||||
logger.error("Oops! `unicode-slugify` was not found.")
|
||||
logger.info("Please remove any other slugify library and install `unicode-slugify`")
|
||||
sys.exit(5)
|
||||
|
||||
|
||||
@@ -53,19 +54,16 @@ def prompt_user_for_selection(items):
|
||||
""" Let the user input a choice. """
|
||||
while True:
|
||||
try:
|
||||
# log.info("Choose your number:")
|
||||
print("Choose your number:")
|
||||
logger.info("Choose your number:")
|
||||
the_chosen_one = int(input("> "))
|
||||
if 1 <= the_chosen_one <= len(items):
|
||||
return items[the_chosen_one - 1]
|
||||
elif the_chosen_one == 0:
|
||||
return None
|
||||
else:
|
||||
# log.warning("Choose a valid number!")
|
||||
print("Chose a valid number!")
|
||||
logger.warning("Choose a valid number!")
|
||||
except ValueError:
|
||||
# log.warning("Choose a valid number!")
|
||||
print("Chose a valid number!")
|
||||
logger.warning("Choose a valid number!")
|
||||
|
||||
|
||||
def is_spotify(raw_song):
|
||||
|
||||
Reference in New Issue
Block a user