Verify if downloadable
This commit is contained in:
@@ -61,7 +61,7 @@ func (dl *Downloader) DownloadFile(
|
||||
return
|
||||
}
|
||||
|
||||
unrestrict := torMgr.UnrestrictFileUntilOk(file)
|
||||
unrestrict := torMgr.UnrestrictFileUntilOk(file, cfg.ShouldServeFromRclone())
|
||||
if unrestrict == nil {
|
||||
log.Warnf("File %s cannot be unrestricted (link=%s)", fileName, file.Link)
|
||||
if err := file.State.Event(context.Background(), "break_file"); err != nil {
|
||||
@@ -104,7 +104,7 @@ func (dl *Downloader) DownloadLink(
|
||||
log *logutil.Logger,
|
||||
) {
|
||||
// log.Debugf("Opening file %s (%s)", fileName, link)
|
||||
unrestrict := torMgr.UnrestrictLinkUntilOk(link)
|
||||
unrestrict := torMgr.UnrestrictLinkUntilOk(link, cfg.ShouldServeFromRclone())
|
||||
if unrestrict == nil {
|
||||
log.Warnf("File %s cannot be unrestricted (link=%s)", fileName, link)
|
||||
http.Error(resp, "File is not available", http.StatusInternalServerError)
|
||||
|
||||
Reference in New Issue
Block a user