diff --git a/internal/universal/downloader.go b/internal/universal/downloader.go index 56acd47..7aa15bc 100644 --- a/internal/universal/downloader.go +++ b/internal/universal/downloader.go @@ -64,10 +64,11 @@ func (dl *Downloader) DownloadFile(directory, torrentName, fileName string, resp http.Error(resp, "File is not available", http.StatusNotFound) return } else { - if unrestrict.Filename != fileName { + unrestrictFilename := strings.TrimPrefix(unrestrict.Filename, "/") + if !strings.Contains(fileName, unrestrictFilename) { // this is possible if there's only 1 streamable file in the torrent // and then suddenly it's a rar file - actualExt := filepath.Ext(unrestrict.Filename) + actualExt := filepath.Ext(unrestrictFilename) expectedExt := filepath.Ext(fileName) if actualExt != expectedExt && unrestrict.Streamable != 1 { log.Warnf("File was changed and is not streamable: %s and %s (link=%s)", fileName, unrestrict.Filename, unrestrict.Link)