mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-11 17:30:00 +02:00
feat: implement Xtream API service for managing live channels, VOD, and series with caching and dynamic backend URL handling.
This commit is contained in:
1 parent
36a4de2140
commit
9f3c29f6dd
4 files changed
+6
-6
No files matched your search
@@ -40,7 +40,7 @@ class EpgApi {
|
||||
'&action=get_epg&stream_id=$channelId&limit=48';
|
||||
|
||||
var response =
|
||||
await http.get(Uri.parse(url)).timeout(const Duration(seconds: 15));
|
||||
await http.get(Uri.parse(url)).timeout(const Duration(seconds: 60));
|
||||
Map<String, dynamic> epgData = {
|
||||
'channel_id': channelId,
|
||||
'programmes': []
|
||||
@@ -57,7 +57,7 @@ class EpgApi {
|
||||
'$dns/player_api.php?username=${playlist.username}&password=${playlist.password}'
|
||||
'&action=get_short_epg&stream_id=$channelId';
|
||||
response =
|
||||
await http.get(Uri.parse(url)).timeout(const Duration(seconds: 10));
|
||||
await http.get(Uri.parse(url)).timeout(const Duration(seconds: 60));
|
||||
if (response.statusCode == 200) {
|
||||
final raw = json.decode(response.body);
|
||||
epgData = _transformEpgData(raw, channelId);
|
||||
|
||||
@@ -69,7 +69,7 @@ Future<String> _resolveRedirects(String url, {int maxRedirects = 5}) async {
|
||||
request.followRedirects = false;
|
||||
|
||||
final response = await client.send(request).timeout(
|
||||
const Duration(seconds: 10),
|
||||
const Duration(seconds: 30),
|
||||
onTimeout: () =>
|
||||
throw TimeoutException('Redirect resolution timeout'),
|
||||
);
|
||||
|
||||
@@ -128,7 +128,7 @@ class RecordingScheduler {
|
||||
final url = '$dns/player_api.php?username=$username&password=$password'
|
||||
'&action=get_simple_data_table&stream_id=$channelId&type=epg&limit=48';
|
||||
|
||||
final response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 15));
|
||||
final response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 60));
|
||||
if (response.statusCode != 200) continue;
|
||||
|
||||
final raw = json.decode(response.body);
|
||||
|
||||
@@ -13,8 +13,8 @@ class ApiClient {
|
||||
_dio = Dio(BaseOptions(
|
||||
baseUrl: _getBaseUrl(),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
connectTimeout: const Duration(seconds: 10),
|
||||
receiveTimeout: const Duration(seconds: 10),
|
||||
connectTimeout: const Duration(seconds: 60),
|
||||
receiveTimeout: const Duration(seconds: 60),
|
||||
),);
|
||||
|
||||
// Add interceptor for logging
|
||||
|
||||
Reference in new issue
Block a user