diff --git a/CHANGELOG.md b/CHANGELOG.md index 38bf03653..84ae28eec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ - [CLI] TorrentPier installer ☕️ [\#1576](https://github.com/torrentpier/torrentpier/pull/1576), [\#1582](https://github.com/torrentpier/torrentpier/pull/1582), [\#1585](https://github.com/torrentpier/torrentpier/pull/1585), [\#1591](https://github.com/torrentpier/torrentpier/pull/1591) ([belomaxorka](https://github.com/belomaxorka)) - Added some new HTML meta-tags [\#1562](https://github.com/torrentpier/torrentpier/pull/1562) ([belomaxorka](https://github.com/belomaxorka)) - Added robots meta-tag support 🤖 [\#1587](https://github.com/torrentpier/torrentpier/pull/1587) ([belomaxorka](https://github.com/belomaxorka)) -- Added [TorrServer](https://github.com/YouROK/TorrServer) instance support! 🎞 [\#1603](https://github.com/torrentpier/torrentpier/pull/1603) ([belomaxorka](https://github.com/belomaxorka)) +- Added [TorrServer](https://github.com/YouROK/TorrServer) instance support! 🎞 [\#1603](https://github.com/torrentpier/torrentpier/pull/1603), [\#1623](https://github.com/torrentpier/torrentpier/pull/1623) ([belomaxorka](https://github.com/belomaxorka)) - Newtopic: Added configuring robots indexing [\#1599](https://github.com/torrentpier/torrentpier/pull/1599) ([belomaxorka](https://github.com/belomaxorka)) - Added showing releaser stats in profile [\#1568](https://github.com/torrentpier/torrentpier/pull/1568) ([belomaxorka](https://github.com/belomaxorka)) - Improved `filelist.php` [\#1586](https://github.com/torrentpier/torrentpier/pull/1586) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/src/TorrServerAPI.php b/src/TorrServerAPI.php index c16488227..85dd242df 100644 --- a/src/TorrServerAPI.php +++ b/src/TorrServerAPI.php @@ -110,8 +110,12 @@ class TorrServerAPI $m3uFile = get_attachments_dir() . '/' . self::M3U['prefix'] . $attach_id . self::M3U['extension']; // Make stream call to store torrent in memory - if (!$this->getStream($hash)) { - return false; + for ($i = 0, $max_try = 3; $i <= $max_try; $i++) { + if ($this->getStream($hash)) { + break; + } elseif ($i == $max_try) { + return false; + } } $curl = new Curl(); @@ -124,7 +128,12 @@ class TorrServerAPI $validResponse = false; $responseLines = explode("\n", $curl->response); foreach ($responseLines as $line) { - if (str_contains($line, '#EXTINF')) { + $line = trim($line); + if ($line === '') { + continue; + } + + if (str_starts_with($line, '#EXTINF')) { $validResponse = true; break; }