-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathwv-license.php
More file actions
113 lines (105 loc) · 5.48 KB
/
wv-license.php
File metadata and controls
113 lines (105 loc) · 5.48 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
$id = $_REQUEST['id'];
function secure_values($action, $data)
{
$protec = "";
$method = 'AES-128-CBC';
$ky = 'joincodecrafters';
$iv = substr(sha1($ky.'coolapps'."24662b4f995b7b3d348211c94fdaa080"), 0, 16);
if($action == "encrypt")
{
$encrypted = openssl_encrypt($data, $method, $ky, OPENSSL_RAW_DATA, $iv);
if(!empty($encrypted))
{
$protec = bin2hex($encrypted);
}
}
else
{
$decrypted = openssl_decrypt(hex2bin($data), $method, $ky, OPENSSL_RAW_DATA, $iv);
if(!empty($decrypted))
{
$protec = $decrypted;
}
}
return $protec;
}
{
$getUData = @file_get_contents('secure/_sessionData');
$decUData = secure_values('decrypt', $getUData);
$TATA_DATA = @json_decode($decUData, true);
$TPAUTH = array('access_token' => $TATA_DATA['data']['accessToken'],
'refresh_token' => $TATA_DATA['data']['refreshToken'],
'subscriberID' => $TATA_DATA['data']['userDetails']['sid'],
'subscriberRMN' => $TATA_DATA['data']['userDetails']['rmn'],
'subscriberNAME' => $TATA_DATA['data']['userDetails']['sName'],
'profileID' => $TATA_DATA['data']['userProfile']['id'],
'deviceName' => $TATA_DATA['data']['deviceDetails']['deviceName'],
'entitlements' => $TATA_DATA['data']['userDetails']['entitlements']);
}
//-----------------------------------------------------------------------//
{
$chnDetailsAPI = 'https://kong-tatasky.videoready.tv/content-detail/pub/api/v1/channels/'.$id;
$chnDlHeads = array('Accept-Language: en-US,en;q=0.9',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36',
'device_details: {"pl":"web","os":"WINDOWS","lo":"en-us","app":"1.36.63","dn":"PC","bv":104,"bn":"CHROME","device_id":"24662b4f995b7b3d348211c94fdaa080","device_type":"WEB","device_platform":"PC","device_category":"open","manufacturer":"WINDOWS_CHROME_104","model":"PC","sname":"'.$TPAUTH['subscriberNAME'].'"}',
'Referer: https://watch.tataplay.com/',
'Origin: https://watch.tataplay.com',
'Authorization: bearer '.$TPAUTH['access_token'],
'profileId: '.$TPAUTH['profileID'],
'platform: web',
'locale: ENG',
'kp: false');
$process = curl_init($chnDetailsAPI);
curl_setopt($process, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($process, CURLOPT_HTTPHEADER, $chnDlHeads);
curl_setopt($process, CURLOPT_HEADER, 0);
curl_setopt($process, CURLOPT_TIMEOUT, 10);
curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
$chnOut = curl_exec($process);
curl_close($process);
}
$vUData = @json_decode($chnOut, true);
$widevine = $vUData['data']['detail']['dashWidewineLicenseUrl'];
$mpd = $vUData['data']['detail']['dashWidewinePlayUrl'];
$sub_epid = $vUData['data']['detail']['entitlements']['0'];
{
$jwtpay = ("{\"action\":\"stream\",\"epids\":[{\"epid\":\"Subscription\",\"bid\":\"$sub_epid\"}]}");
$sherlocation = 'https://tm.tapi.videoready.tv/auth-service/v1/oauth/token-service/token';
$sherheads = array('Accept-Language: en-US,en;q=0.9',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36',
'content-type: application/json',
'device_details: {"pl":"web","os":"WINDOWS","lo":"en-us","app":"1.36.63","dn":"PC","bv":104,"bn":"CHROME","device_id":"24662b4f995b7b3d348211c94fdaa080","device_type":"WEB","device_platform":"PC","device_category":"open","manufacturer":"WINDOWS_CHROME_104","model":"PC","sname":"'.$TPAUTH['subscriberNAME'].'"}',
'kp: false',
'locale: ENG',
'platform: web',
'profileId: '.$TPAUTH['profileID'],
'Referer: https://watch.tataplay.com/',
'x-device-id: '."24662b4f995b7b3d348211c94fdaa080",
'x-device-platform: PC',
'x-device-type: WEB',
'x-subscriber-id: '.$TPAUTH['subscriberID'],
'x-subscriber-name: '.$TPAUTH['subscriberNAME'],
'Authorization: bearer '.$TPAUTH['access_token'],
'Origin: https://watch.tataplay.com');
$sherposts = $jwtpay;
$process = curl_init($sherlocation);
curl_setopt($process, CURLOPT_POST, 1);
curl_setopt($process, CURLOPT_POSTFIELDS, $sherposts);
curl_setopt($process, CURLOPT_HTTPHEADER, $sherheads);
curl_setopt($process, CURLOPT_HEADER, 0);
curl_setopt($process, CURLOPT_ENCODING, '');
curl_setopt($process, CURLOPT_TIMEOUT, 10);
curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
$vrswvx = curl_exec($process);
curl_close($process);
$mksaz= @json_decode($vrswvx, true);
$ls_session = 'ls_session='.$mksaz['data']['token'];
$licurl = $widevine.'&'.$ls_session;
http_response_code(307);
header("Location: $licurl");
exit();
}
?>