Repair edge cases

This commit is contained in:
Ben Sarmiento
2024-01-19 04:22:56 +01:00
parent 6c7c57ebfa
commit ccd260db6a
5 changed files with 16 additions and 9 deletions

View File

@@ -122,7 +122,11 @@ func (t *TorrentManager) UnrestrictUntilOk(link string) *realdebrid.Download {
if download, exists := t.DownloadCache.Get(link); exists {
return download
}
ret, _ := t.Api.UnrestrictLink(link, t.Config.ShouldServeFromRclone())
ret, err := t.Api.UnrestrictLink(link, t.Config.ShouldServeFromRclone())
if err != nil {
t.log.Warnf("Cannot unrestrict link %s: %v", link, err)
return nil
}
if ret != nil && ret.Link != "" {
if strings.Contains(ret.Download, "download.real-debrid.") {
prefHost := t.Config.GetRandomPreferredHost()