revisions

This commit is contained in:
2025-01-14 11:10:13 -05:00
parent 3c23bc93f6
commit f3336b09ac
5 changed files with 58 additions and 37 deletions

View File

@@ -4,11 +4,15 @@
import sys
sys.path.insert(1,'..')
import traceback
import logging
from aiohttp import ClientTimeout, ClientSession
from lyric_search_new import utils
from lyric_search_new.constructors import LyricsResult
from . import common
logger = logging.getLogger()
log_level = logging.getLevelName(logger.level)
class InvalidResponseException(Exception):
"""
Invalid Response Exception
@@ -68,14 +72,15 @@ class LRCLib:
candidate_tracks=[(0, returned_track)])
if not confidence:
return # No suitable match found
print("Returning!")
logging.info("Result found on %s", self.label)
return LyricsResult(artist=returned_artist,
song=returned_song,
src=self.label,
lyrics=returned_lyrics,
confidence=confidence)
except:
traceback.print_exc()
if log_level == "DEBUG":
traceback.print_exc()
return