forked from theraw/FOS-Streaming-v69
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getfile.php
68 lines (60 loc) · 2.18 KB
/
getfile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
ob_start();
include('config.php');
logincheck();
set_time_limit(0);
if (!isset($_GET['id'])) {
die();
}
$id = $_GET['id'];
$user = User::find($id);
$setting = Setting::first();
if (isset($_GET['e2'])) {
echo "#NAME FOS-Streaming \r\n";
foreach ($user->categories as $category) {
foreach ($category->streams as $stream) {
if ($stream->running == 1) {
echo "#SERVICE 1:0:1:0:0:0:0:0:0:0:http%3A//" . $setting->webip . "%3A" . $setting->webport . "/live/" . $user->username . "/" . $user->password . "/" . $stream->id . "\r\n";
echo "#DESCRIPTION " . $stream->name . "\r\n";
}
}
}
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="userbouquet.favourites.tv"');
header("Content-Transfer-Encoding: binary");
header('Pragma: no-cache');
header('Expires: 0');
die;
}
if (isset($_GET['m3u'])) {
echo "#EXTM3U \r\n";
foreach ($user->categories as $category) {
foreach ($category->streams as $stream) {
if ($stream->running == 1) {
echo "#EXTINF:0," . $stream->name . "\r\n";
echo "http://" . $setting->webip . ":" . $setting->webport . "/live/" . $user->username . "/" . $user->password . "/" . $stream->id . "\r\n";
}
}
}
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="tv_user.m3u"');
header("Content-Transfer-Encoding: binary");
header('Pragma: no-cache');
header('Expires: 0');
die;
}
if (isset($_GET['tv'])) {
foreach ($user->categories as $category) {
foreach ($category->streams as $stream) {
if ($stream->running == 1) {
echo "ext,$stream->name,http://" . $setting->webip . ":" . $setting->webport . "/live/" . $user->username . "/" . $user->password . "/" . $stream->name . "\r\n";
}
}
}
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="Channels.txt"');
header("Content-Transfer-Encoding: binary");
header('Pragma: no-cache');
header('Expires: 0');
die;
}