View Single Post
  #2  
Old 09-29-2015, 09:12 PM
biezom biezom is offline
Senior Member
 
Join Date: Sep 2014
Posts: 1,025
biezom is on a distinguished road
Default

Re: How to auto extract m3u8 and auto start recording


Quote:
Originally Posted by sonnvl View Post
Is there any tool that auto extract m3u8 from a site and auto start recording that stream.
(Similar Jaksta recorder)

Eg. All below links contain m3u8 with variant token and I want to auto extract m3u8 list and auto start recording (using livestreamer of ffmpeg....)
http://tv.101vn.com/ok/vtc/youtv_2.php
http://viewtv.vn/live

Because I want to make task schedule to record at given time while I'm not online.

Thanks !

with php code it's possible

Code:
<?php
$return=file_get_contents("http://tv.101vn.com/ok/vtc/youtv_2.php"); preg_match('/src=\'(.*?)\'/', $return, $matche);
$return2=file_get_contents("$matche[1]"); preg_match('/responseText = "(.*?)"/', $return2, $m3u8); $hls=str_replace("http","hlsvariant://http",$m3u8[1]);
$date = date("H:i_d-m-Y"); $outputfile= $date . "-hanoi-cab2.ts";
echo "Starting livestreamer...\n\n";
		echo shell_exec("livestreamer  \"$hls\" best -o \"$outputfile\" &");
		echo "Done.\n";
?>


Code:
<?php
$return=file_get_contents("http://viewtv.vn/live"); preg_match('/iosUrl =\'(.*?)\'/', $return, $m3u8);
$hls=str_replace("http","hlsvariant://http",$m3u8[1]); $date = date("H:i_d-m-Y"); $outputfile= $date . "-vt8.ts";
echo "Starting livestreamer...\n\n";
		echo shell_exec("livestreamer  \"$hls\" best -o \"$outputfile\" &");
		echo "Done.\n";
?>
Reply With Quote