This repository has been archived by the owner on Feb 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 128
/
Copy pathstream.php
68 lines (58 loc) · 2.07 KB
/
stream.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
// DO NO EDIT ANYTHING TO WORK PORPELY
// © @AvishkarPatil | https://github.com/avipatilpro
require ('token.php');
$crm = $auth['sessionAttributes']['user']['subscriberId'];
$uniqueId = $auth['sessionAttributes']['user']['unique'];
if (@$_REQUEST["key"] != "")
{
$headers = array(
'appkey'=> 'NzNiMDhlYzQyNjJm',
'channelid' => '0',
'crmid'=> "$crm",
'deviceId'=> '3022048329094879',
'devicetype'=> 'phone',
'isott'=> 'true',
'languageId'=> '6',
'lbcookie'=> '1',
'os'=> 'android',
'osVersion'=> '5.1.1',
'srno'=> '200206173037',
'ssotoken'=> "$ssoToken",
'subscriberId'=> "$crm",
'uniqueId'=> "$uniqueId",
'User-Agent'=> 'plaYtv/6.0.9 (Linux; Android 5.1.1) ExoPlayerLib/2.13.2',
'usergroup'=> 'tvYR7NSNn7rymo3F',
'versionCode'=> '260'
);
$opts = ['http' => ['method' => 'GET', 'header' => array_map(function ($h, $v)
{
return "$h: $v";
}
, array_keys($headers) , $headers) , ]];
$cache = str_replace("/", "_", $_REQUEST["key"]);
if (!file_exists($cache))
{
$context = stream_context_create($opts);
$haystack = file_get_contents("https://tv.media.jio.com/streams_live/" . $_REQUEST["key"] . $token, false, $context);
}
else
{
$haystack = file_get_contents($cache);
}
echo $haystack;
}
if (@$_REQUEST["ts"] != "")
{
header("Content-Type: video/mp2t");
header("Connection: keep-alive");
header("Access-Control-Allow-Origin: *");
header("Access-Control-Expose-Headers: Content-Length,Content-Range");
header("Access-Control-Allow-Headers: Range");
header("Accept-Ranges: bytes");
$opts = ["http" => ["method" => "GET", "header" => "User-Agent: plaYtv/6.0.9 (Linux; Android 5.1.1) ExoPlayerLib/2.13.2"]];
$context = stream_context_create($opts);
$haystack = file_get_contents("https://jiotv.live.cdn.jio.com/" . $_REQUEST["ts"], false, $context);
echo $haystack;
}
?>