0
0
mirror of https://github.com/anthonyaxenov/iptv.git synced 2024-11-22 05:24:45 +00:00

curl timeout

This commit is contained in:
Anthony Axenov 2023-12-03 16:31:10 +08:00
parent 724ccfa40c
commit 29b35d014d
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC

View File

@ -30,11 +30,10 @@ final class PlaylistProcessor
$filepath = config_path('playlists.ini'); $filepath = config_path('playlists.ini');
$this->updated_at = date('d.m.Y h:i', filemtime($filepath)); $this->updated_at = date('d.m.Y h:i', filemtime($filepath));
$this->playlists = collect(parse_ini_file($filepath, true)) $this->playlists = collect(parse_ini_file($filepath, true))
->transform(function ($playlist, $id) { ->transform(static fn ($playlist, $id) => empty($playlist['redirect'])
return empty($playlist['redirect']) ? new Playlist((string)$id, $playlist)
? new Playlist((string)$id, $playlist) : new RedirectedPlaylist((string)$id, $playlist['redirect'])
: new RedirectedPlaylist((string)$id, $playlist['redirect']); );
});
} }
/** /**
@ -97,7 +96,7 @@ final class PlaylistProcessor
curl_setopt_array($curl, [ curl_setopt_array($curl, [
CURLOPT_URL => $this->playlist($id)->pls, CURLOPT_URL => $this->playlist($id)->pls,
CURLOPT_RETURNTRANSFER => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 5, CURLOPT_TIMEOUT => 30,
CURLOPT_HEADER => false, CURLOPT_HEADER => false,
CURLOPT_FAILONERROR => true, CURLOPT_FAILONERROR => true,
]); ]);