Resolve infuse routing issues
This commit is contained in:
@@ -51,7 +51,6 @@ func (dl *Downloader) DownloadFile(directory, torrentName, fileName string, resp
|
||||
}
|
||||
link := file.Link
|
||||
|
||||
log.Debugf("Opening file %s from torrent %s (%s)", fileName, torrentName, link)
|
||||
unrestrict := torMgr.UnrestrictUntilOk(link)
|
||||
if unrestrict == nil {
|
||||
log.Warnf("File %s cannot be unrestricted (link=%s)", fileName, link)
|
||||
@@ -103,7 +102,6 @@ func (dl *Downloader) DownloadLink(fileName, link string, resp http.ResponseWrit
|
||||
return
|
||||
}
|
||||
|
||||
log.Debugf("Opening download %s", fileName)
|
||||
unrestrict := torMgr.UnrestrictUntilOk(link)
|
||||
if unrestrict == nil {
|
||||
log.Warnf("File %s cannot be unrestricted (link=%s)", fileName, link)
|
||||
@@ -151,8 +149,17 @@ func (dl *Downloader) streamFileToResponse(torrent *intTor.Torrent, file *intTor
|
||||
}
|
||||
|
||||
// copy range header if it exists
|
||||
rangeLog := ""
|
||||
if req.Header.Get("Range") != "" {
|
||||
dlReq.Header.Add("Range", req.Header.Get("Range"))
|
||||
rangeLog = " (range: " + req.Header.Get("Range") + ")"
|
||||
|
||||
}
|
||||
|
||||
if torrent != nil {
|
||||
log.Debugf("Downloading file %s from torrent %s (%s)%s", file.Path, torrent.Name, unrestrict.Link, rangeLog)
|
||||
} else {
|
||||
log.Debugf("Downloading file %s (%s)%s", file.Path, unrestrict.Link, rangeLog)
|
||||
}
|
||||
|
||||
download, err := dl.client.Do(dlReq)
|
||||
|
||||
Reference in New Issue
Block a user