Content-Length: 207971 | pFad | http://github.com/moehmeni/syncedlyrics/commit/851ef0ef6ee721d440c1d83f44c28ee9bdab3b5d

70 Return None in case of not expected result · moehmeni/syncedlyrics@851ef0e · GitHub
Skip to content

Commit

Permalink
Return None in case of not expected result
Browse files Browse the repository at this point in the history
Fixes #52
  • Loading branch information
moehmeni committed Jul 28, 2024
1 parent bc97f85 commit 851ef0e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions syncedlyrics/providers/musixmatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ def get_lrc(self, search_term: str) -> Optional[Lyrics]:
self.logger.warning(f"Got status code {status_code} for {search_term}")
return None
body = r.json()["message"]["body"]
if not isinstance(body, dict):
return None
tracks = body["track_list"]
cmp_key = lambda t: f"{t['track']['track_name']} {t['track']['artist_name']}"
track = get_best_match(tracks, search_term, cmp_key)
Expand Down

0 comments on commit 851ef0e

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/moehmeni/syncedlyrics/commit/851ef0ef6ee721d440c1d83f44c28ee9bdab3b5d

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy