Add FLAC lyrics embedding with LRCLIB fallback (#151)

* Update lyrics code

* Refactor DownloadFile to use default HTTP client
This commit is contained in:
Sepehr Aroofzade
2025-12-13 00:39:22 +03:30
committed by GitHub
parent ffd4daf031
commit 76669f551e
6 changed files with 346 additions and 5 deletions
+7 -1
View File
@@ -173,7 +173,13 @@ func (d *DeezerDownloader) GetDownloadURL(trackID int64) (string, error) {
}
func (d *DeezerDownloader) DownloadFile(url, filepath string) error {
resp, err := d.client.Get(url)
// Use a separate client with a longer timeout. The default client's 60s limit
// causes downloads to fail on slow connections or for large Hi-Res files.
downloadClient := &http.Client{
Timeout: 5 * time.Minute, // 5 minutes for large files
}
resp, err := downloadClient.Get(url)
if err != nil {
return fmt.Errorf("failed to download file: %w", err)
}