forked from mitthu786/TS-JioTV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoken.php
36 lines (32 loc) · 792 Bytes
/
token.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
<?php
$creds = json_decode(file_get_contents('assets/data/creds.json') , true);
$ssoToken = $creds['ssoToken'];
$jctBase = "cutibeau2ic";
function tokformat($str)
{
$str = base64_encode(md5($str, true));
return str_replace("\n", "", str_replace("\r", "", str_replace("/", "_", str_replace("+", "-", str_replace("=", "", $str)))));
}
function generateJct($st, $pxe)
{
global $jctBase;
return trim(tokformat($jctBase . $st . $pxe));
}
function generatePxe()
{
return time() + 6000000;
}
function generateSt()
{
global $ssoToken;
return tokformat($ssoToken);
}
function generateToken()
{
$st = generateSt();
$pxe = generatePxe();
$jct = generateJct($st, $pxe);
return "?jct=" . $jct . "&pxe=" . $pxe . "&st=" . $st;
}
$token = generateToken();
?>