Add VidHub endpoints

This commit is contained in:
Ben Adrian Sarmiento
2024-07-11 15:53:20 +02:00
parent f8f68e8225
commit 396a8781aa
10 changed files with 182 additions and 86 deletions

View File

@@ -140,8 +140,10 @@ func (dl *Downloader) DownloadFile(
}
}
if cfg.ShouldServeFromRclone() {
// log.Debugf("Redirecting to %s", unrestrict.Download)
redirect(resp, req, unrestrict.Download)
} else {
// log.Debugf("Streaming %s", unrestrict.Download)
dl.streamFileToResponse(torrent, file, unrestrict, resp, req, torMgr, cfg, log)
}
}
@@ -156,8 +158,10 @@ func (dl *Downloader) DownloadLink(
log *logutil.Logger,
) {
if cfg.ShouldServeFromRclone() {
// log.Debugf("Redirecting to %s", unrestrict.Download)
redirect(resp, req, unrestrict.Download)
} else {
log.Debugf("Streaming %s", unrestrict.Download)
dl.streamFileToResponse(nil, nil, unrestrict, resp, req, torMgr, cfg, log)
}
}