-
Notifications
You must be signed in to change notification settings - Fork 1
/
TV3.php
24 lines (20 loc) · 848 Bytes
/
TV3.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
<?php
$url = "https://www.dailymotion.com/player/metadata/video/k3GVzd2cWbveXyrApah?embedder=https%3A%2F%2Fwww.xtra.com.my%2Flive-tv&referer=&";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$headers = array(
"Referer: https://www.xtra.com.my/live-tv",
"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
//for debug only!
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
curl_close($curl);
preg_match('/qualities":({.+?}),"/', $resp, $matches);
$arr = json_decode($matches[1], true);
$m3u8_raw = $arr['auto'][0]['url'];
header("Location: ".$m3u8_raw);
?>