feat: initial implementation of navidrome-music-sync with Yandex, Spotify, Apple, YouTube support and Web UI
This commit is contained in:
1 parent
44c67ab49d
commit
5b6c2c72f7
23 files changed
+1445
-2
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import os
|
||||
import syncedlyrics
|
||||
|
||||
def fetch_and_save_lyrics(dest_audio_path: str, search_query: str) -> bool:
|
||||
"""Download synchronized LRC lyrics and save beside audio file."""
|
||||
lrc_path = os.path.splitext(dest_audio_path)[0] + ".lrc"
|
||||
if os.path.exists(lrc_path):
|
||||
return True
|
||||
|
||||
try:
|
||||
lrc = syncedlyrics.search(search_query)
|
||||
if lrc:
|
||||
with open(lrc_path, "w", encoding="utf-8") as f:
|
||||
f.write(lrc)
|
||||
return True
|
||||
except Exception as e:
|
||||
print(f"Warning: Failed to fetch lyrics for '{search_query}': {e}")
|
||||
return False
|
||||
Reference in new issue
Block a user