Added Https service. Fix for #188 How enable https? (#312)

* https service added on port 8091 default

* https port check

* format

* readme

* readme

* readme

* readme

---------

Co-authored-by: evfedoto <evfedoto@cisco.com>
Co-authored-by: nikk <tsynik@gmail.com>
This commit is contained in:
Evgeni
2023-11-13 00:50:11 +01:00
committed by GitHub
parent 792f87380d
commit a91e6eb11b
23 changed files with 46811 additions and 2120 deletions

View File

@@ -71,6 +71,9 @@ func (t *Torrent) Preload(index int, size int64) {
if ffprobe.Exists() {
link := "http://127.0.0.1:" + settings.Port + "/play/" + t.Hash().HexString() + "/" + strconv.Itoa(index)
if settings.Ssl {
link = "https://127.0.0.1:" + settings.SslPort + "/play/" + t.Hash().HexString() + "/" + strconv.Itoa(index)
}
if data, err := ffprobe.ProbeUrl(link); err == nil {
t.BitRate = data.Format.BitRate
t.DurationSeconds = data.Format.DurationSeconds