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
@@ -169,7 +169,13 @@ func (q *QobuzDownloader) GetDownloadURL(trackID int64, quality string) (string,
func (q *QobuzDownloader) DownloadFile(url, filepath string) error {
fmt.Println("Starting file download...")
resp, err := q.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)
}