forked from Jitendraunatti/jio-widevine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
widevine.php
42 lines (38 loc) · 1.52 KB
/
widevine.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
<?php
if (isset($_GET['id'])) {
$id = $_GET['id'];
$license_file = 'jitendraunatti.txt';
$license_data = @json_decode(file_get_contents($license_file), true);
$current_time = time();
if (!$license_data || ($current_time - $license_data['JITENDRAUNATTI']['time']) > 3600) {
$apixurl = 'https://jio-widevine.developed-by-doctor-strange.workers.dev/?id=' . $id;
$apixheaders = ['user-agent: okhttp/4.10.0'];
$xcurl = curl_init($apixurl);
curl_setopt($xcurl, CURLOPT_ENCODING, "gzip");
curl_setopt($xcurl, CURLOPT_HTTPHEADER, $apixheaders);
curl_setopt($xcurl, CURLOPT_HEADER, 0);
curl_setopt($xcurl, CURLOPT_TIMEOUT, 5);
curl_setopt($xcurl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($xcurl, CURLOPT_FOLLOWLOCATION, 1);
$return = curl_exec($xcurl);
curl_close($xcurl);
$json_data = @json_decode($return, true);
if ($json_data['JITENDRAUNATTI']['message'] == 'success') {
$license = $json_data['JITENDRAUNATTI']['licence'];
$ROLEX = json_encode(array(
"JITENDRAUNATTI" => array(
"licence" => $license,
"time" => $current_time
)
));
file_put_contents($license_file, $ROLEX);
header("Location: " . $license, true, 307);
}
} else {
$license = $license_data['JITENDRAUNATTI']['licence'];
header("Location: " . $license, true, 307);
}
} else {
echo 'ID not provided.';
}
?>