diff --git a/spotdl/providers/lyrics/synced.py b/spotdl/providers/lyrics/synced.py index 200fd6a4e..d6cc6626e 100644 --- a/spotdl/providers/lyrics/synced.py +++ b/spotdl/providers/lyrics/synced.py @@ -4,6 +4,7 @@ from typing import Dict, List, Optional +import requests import syncedlyrics from spotdl.providers.lyrics.base import LyricsProvider @@ -46,7 +47,7 @@ def extract_lyrics(self, url: str, **kwargs) -> Optional[str]: raise NotImplementedError - def get_lyrics(self, name: str, artists: List[str], **_) -> Optional[str]: + def get_lyrics(self, name: str, artists: List[str], **kwargs) -> Optional[str]: """ Try to get lyrics using syncedlyrics @@ -59,6 +60,19 @@ def get_lyrics(self, name: str, artists: List[str], **_) -> Optional[str]: - The lyrics of the song or None if no lyrics were found. """ - lyrics = syncedlyrics.search(f"{name} - {artists[0]}", allow_plain_format=True) - - return lyrics + try: + lyrics = syncedlyrics.search( + f"{name} - {artists[0]}", + allow_plain_format=kwargs.get("allow_plain_format", True), + ) + return lyrics + except requests.exceptions.SSLError: + # Max retries reached + return None + except TypeError: + # Error at syncedlyrics.providers.musixmatch L89 - + # Because `body` is occasionally an empty list instead of a dictionary. + # We get this error when allow_plain_format is set to True, + # and there are no synced lyrics present + # Because its empty, we know there are no lyrics + return None diff --git a/spotdl/utils/ffmpeg.py b/spotdl/utils/ffmpeg.py index 1ec0d7178..f7a364667 100644 --- a/spotdl/utils/ffmpeg.py +++ b/spotdl/utils/ffmpeg.py @@ -47,7 +47,7 @@ }, "darwin": { "x86_64": "https://github.com/eugeneware/ffmpeg-static/releases/download/b4.4/darwin-x64", - "arm": "https://github.com/eugeneware/ffmpeg-static/releases/download/b4.4/darwin-arm64", + "arm64": "https://github.com/eugeneware/ffmpeg-static/releases/download/b4.4/darwin-arm64", }, } @@ -215,17 +215,27 @@ def download_ffmpeg() -> Path: os_name = platform.system().lower() os_arch = platform.machine().lower() + ffmpeg_url: Optional[str] = None + + # if platform.system() == "Darwin" and ( + # platform.processor() == "arm" + # or subprocess.run(["sysctl", "-n", "sysctl.proc_translated"], check=False) + # ): + # ffmpeg_url = FFMPEG_URLS["darwin"]["arm"] + # else: + # ffmpeg_url = FFMPEG_URLS.get(os_name, {}).get(os_arch) ffmpeg_url = FFMPEG_URLS.get(os_name, {}).get(os_arch) + + if ffmpeg_url is None: + raise FFmpegError("FFmpeg binary is not available for your system.") + ffmpeg_path = Path( os.path.join( get_spotdl_path(), "ffmpeg" + (".exe" if os_name == "windows" else "") ) ) - if ffmpeg_url is None: - raise FFmpegError("FFmpeg binary is not available for your system.") - # Download binary and save it to a file in spotdl directory ffmpeg_binary = requests.get(ffmpeg_url, allow_redirects=True, timeout=10).content with open(ffmpeg_path, "wb") as ffmpeg_file: