works again

This commit is contained in:
lars
2022-11-22 18:25:35 +01:00
parent 09fbb57380
commit 01c27efda5
6 changed files with 100 additions and 35 deletions

View File

@@ -40,7 +40,7 @@ class Youtube(AudioSource):
super().fetch_source(song)
if not song.has_isrc():
return
return None
real_title = song.title.lower()
@@ -58,7 +58,8 @@ class Youtube(AudioSource):
final_result = result
if final_result is None:
return False
return None
logger.info(f"found video {final_result}")
return final_result['url']
@classmethod
@@ -84,6 +85,7 @@ class Youtube(AudioSource):
logger.warning(f"youtube blocked downloading. ({trie}-{MAX_TRIES})")
if trie >= MAX_TRIES:
logger.warning("too many tries, returning")
return False
logger.warning(f"retrying in {WAIT_BETWEEN_BLOCK} seconds again")
time.sleep(WAIT_BETWEEN_BLOCK)
return cls.fetch_audio(song, src, trie=trie + 1)