Fix verify download link logic, remove the setting
This commit is contained in:
@@ -80,13 +80,6 @@ func (dl *Downloader) DownloadFile(directory, torrentName, fileName string, resp
|
||||
}
|
||||
}
|
||||
if cfg.ShouldServeFromRclone() {
|
||||
if cfg.ShouldVerifyDownloadLink() {
|
||||
if !dl.client.CanFetchFirstByte(unrestrict.Download) {
|
||||
log.Warnf("File %s is not available", fileName)
|
||||
http.Error(resp, "File is not available", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
}
|
||||
redirect(resp, req, unrestrict.Download, cfg)
|
||||
} else {
|
||||
dl.streamFileToResponse(torrent, file, unrestrict, resp, req, torMgr, cfg, log)
|
||||
@@ -105,13 +98,6 @@ func (dl *Downloader) DownloadLink(fileName, link string, resp http.ResponseWrit
|
||||
return
|
||||
} else {
|
||||
if cfg.ShouldServeFromRclone() {
|
||||
if cfg.ShouldVerifyDownloadLink() {
|
||||
if !dl.client.CanFetchFirstByte(unrestrict.Download) {
|
||||
log.Warnf("File %s is not available", fileName)
|
||||
http.Error(resp, "File is not available", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
}
|
||||
redirect(resp, req, unrestrict.Download, cfg)
|
||||
} else {
|
||||
dl.streamFileToResponse(nil, nil, unrestrict, resp, req, torMgr, cfg, log)
|
||||
|
||||
Reference in New Issue
Block a user