mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
* Fixes #272 by refactoring global log to conventional global as used by logzero * Remove unnecessary logger from download_single, which was a test case * Remove unnecessary logger from main(), which was a test case
This commit is contained in:
committed by
Ritiek Malhotra
parent
803a677167
commit
32c2ace96c
@@ -8,9 +8,11 @@ from spotdl import convert
|
||||
from spotdl import internals
|
||||
from spotdl import spotify_tools
|
||||
from spotdl import youtube_tools
|
||||
from logzero import logging as log
|
||||
from slugify import slugify
|
||||
import spotipy
|
||||
import urllib.request
|
||||
import logzero
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
@@ -109,6 +111,7 @@ def download_list(text_file):
|
||||
|
||||
def download_single(raw_song, number=None):
|
||||
""" Logic behind downloading a song. """
|
||||
|
||||
if internals.is_youtube(raw_song):
|
||||
log.debug('Input song is a YouTube URL')
|
||||
content = youtube_tools.go_pafy(raw_song, meta_tags=None)
|
||||
@@ -182,10 +185,8 @@ def main():
|
||||
internals.filter_path(const.args.folder)
|
||||
youtube_tools.set_api_key()
|
||||
|
||||
const.log = const.logzero.setup_logger(formatter=const._formatter,
|
||||
level=const.args.log_level)
|
||||
global log
|
||||
log = const.log
|
||||
logzero.setup_default_logger(formatter=const._formatter, level=const.args.log_level)
|
||||
|
||||
log.debug('Python version: {}'.format(sys.version))
|
||||
log.debug('Platform: {}'.format(platform.platform()))
|
||||
log.debug(pprint.pformat(const.args.__dict__))
|
||||
|
||||
Reference in New Issue
Block a user