Fix for invalid_download_code

This commit is contained in:
Ben Adrian Sarmiento
2024-06-30 23:29:29 +02:00
parent bf193a2656
commit f3d6230935
5 changed files with 46 additions and 20 deletions

View File

@@ -78,12 +78,12 @@ func (rd *RealDebrid) UnrestrictAndVerify(link string) (*Download, error) {
rd.TokenManager.SetTokenAsExpired(token, "bandwidth limit exceeded")
continue
}
if err != nil {
return nil, err
if err == nil {
rd.verifiedLinks.Set(download.ID, time.Now().Unix()+60*60*24)
return download, nil
}
rd.verifiedLinks.Set(download.ID, time.Now().Unix()+60*60*24)
return download, nil
rd.verifiedLinks.Remove(download.ID)
tokenMap.Remove(link)
}
download, err := rd.UnrestrictLinkWithToken(link, token)