mirror of
https://github.com/torrentpier/torrentpier.git
synced 2025-03-12 04:35:42 -07:00
Some improvements for TorrServer API (#1623)
* Some improvements for TorrServer API * Update CHANGELOG.md
This commit is contained in:
parent
accc24a969
commit
658bfe24b5
@ -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))
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user