forked from Jitendraunatti/jio-widevine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mpd.php
33 lines (25 loc) · 976 Bytes
/
mpd.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
<?php
if (isset($_GET['id'])) {
$apiurl = "https://tv.media.jio.com/apis/v2.0/getchannelurl/getchannelurl";
$apipost = json_encode(array('channel_id' => $_GET['id']));
$apiheaders = array("Content-Type: application/json");
$process = curl_init($apiurl);
curl_setopt($process, CURLOPT_POST, 1);
curl_setopt($process, CURLOPT_POSTFIELDS, $apipost);
curl_setopt($process, CURLOPT_HTTPHEADER, $apiheaders);
curl_setopt($process, CURLOPT_HEADER, 0);
curl_setopt($process, CURLOPT_TIMEOUT, 5);
curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
$return = curl_exec($process);
curl_close($process);
$json_data = @json_decode($return, true);
if ($json_data['message'] == 'Success' && isset($json_data['mpd']['result'])) {
$mpd = $json_data['mpd']['result'];
if (isset($mpd)) {
header("Location: " . $mpd);
}
}
} else {
echo "somwething went wrong";
}