revisions
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
#!/usr/bin/env python3.12
|
||||
# pylint: disable=bare-except, broad-exception-caught, wrong-import-position
|
||||
# pylint: disable=bare-except, broad-exception-caught, wrong-import-order, wrong-import-position
|
||||
|
||||
import sys
|
||||
sys.path.insert(1,'..')
|
||||
import traceback
|
||||
import logging
|
||||
from aiohttp import ClientTimeout, ClientSession
|
||||
from bs4 import BeautifulSoup
|
||||
import html as htm
|
||||
@@ -12,8 +13,12 @@ from . import common
|
||||
from lyric_search_new import utils
|
||||
from lyric_search_new.constructors import LyricsResult
|
||||
|
||||
logger = logging.getLogger()
|
||||
log_level = logging.getLevelName(logger.level)
|
||||
|
||||
class InvalidResponseException(Exception):
|
||||
"""
|
||||
InvalidResponseException
|
||||
"""
|
||||
|
||||
class Genius:
|
||||
@@ -94,6 +99,7 @@ class Genius:
|
||||
returned_lyrics = self.datautils.scrub_lyrics(returned_lyrics)
|
||||
artist = track.split(" - ", maxsplit=1)[0]
|
||||
song = track.split(" - ", maxsplit=1)[1]
|
||||
logging.info("Result found on %s", self.label)
|
||||
return LyricsResult(artist=artist,
|
||||
song=song,
|
||||
src=self.label,
|
||||
@@ -101,7 +107,8 @@ class Genius:
|
||||
confidence=confidence)
|
||||
|
||||
except:
|
||||
traceback.print_exc()
|
||||
if log_level == "DEBUG":
|
||||
traceback.print_exc()
|
||||
return
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user