json - PHP fetch with file_get_contents() funtion -
i want m3u8 link site on other php page
for example : site : "view-source:http://lideo.ru/embed/9528"
i want extract m3u8 other php page : http://hls.lideo.ru/liveapp/09528_bd608448e6c4a218d16b1f7b4018f6e8/index.m3u8?tokenhash=tiai4tluwzhdlos5mjnoqw
i'm tried code seems not working
$url = "http://lideo.ru/embed/9528"; $contents = file_get_contents($url); preg_match('@m3u8([^"]+)@',$contents,$rtmp); $link = urldecode($link[0]); echo $link;
any please because i'm not soo in php :)
thanks
try this:
$url = "http://lideo.ru/embed/9528"; $contents = file_get_contents($url); preg_match('/(https?\:\/\/[^\']*\.m3u8\?[^\']*)/', $contents, $result); $link = urldecode($result[0]); echo $link;
Comments
Post a Comment