fix preload with ffprobe

This commit is contained in:
nikk gitanes
2023-03-02 02:52:34 +03:00
parent 478c7a1d2f
commit 56f082e65d
2 changed files with 8 additions and 2 deletions

View File

@@ -66,7 +66,7 @@ func (t *Torrent) Preload(index int, size int64) {
}()
if ffprobe.Exists() {
host := "http://127.0.0.1:" + settings.Port + "/stream?link=" + t.Hash().HexString() + "&index=" + strconv.Itoa(index) + "&play"
host := "http://127.0.0.1:" + settings.Port + "/play/" + t.Hash().HexString() + "/" + strconv.Itoa(index) // + "&play"
if data, err := ffprobe.ProbeUrl(host); err == nil {
t.BitRate = data.Format.BitRate
t.DurationSeconds = data.Format.DurationSeconds