View Single Post
  #6  
Old 09-30-2015, 04:27 AM
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
Thanks Biezom
What about this:
Code:
http://vuapp.tranvu.info/#tivi/173
Generate link:
Code:
http://vuapp.tranvu.info/api/channel/getnexttv?channel=5h503z5s5058553n5a6n786a5u715a765j3n5q6o6v6k5a46435z594759576z5d5h3c585ed645920e395fedad7bbbed0eca3fe2e05s56&token=313434313935333134385f305f305f776562&mobile=0
I grab this link:
Code:
http://125.212.201.169:1935/liveedge/_definst_/amlst:$vtc8$stream$_p2!250000!0!480!360$_p3!800000!0!640!480/playlist.m3u8?data=b00c5416ba2f281c2f01319e9e5e2d0236777e07b597de3ffd7bac0a06f5af0da96175989dd7e573ce85f6aac805a4ea&expired=1443608952362
But I want to change to get higher quality
Code:
http://125.212.201.169:1935/liveedge/_definst_/amlst:$vtc8$stream$_p5!800000!0!768!576/playlist.m3u8?data=b00c5416ba2f281c2f01319e9e5e2d0236777e07b597de3ffd7bac0a06f5af0da96175989dd7e573ce85f6aac805a4ea&expired=1443608952362
Can use php for this case ?
yes for the php code

p5!800000!0!768!576 and _p3!800000!0!640!480 are the same quality BANDWIDTH=800000 just the radio change


Code:
<?php
$return=file_get_contents("http://vuapp.tranvu.info/#tivi/173"); preg_match('/token: "(.*?)"/', $return, $token);

$return2=file_get_contents("http://vuapp.tranvu.info/api/channel/info?id=173&token=$token[1]&mobile=0");

preg_match('/"link":"(.*?)"/', $return2, $channel);

$return3=file_get_contents("http://vuapp.tranvu.info/api/channel/getnexttv?channel=$channel[1]&token=$token[1]&mobile=0");
preg_match('/"url":"(.*?)"/', $return3, $m3u8);
$badformat = array('\\','u0026','_p2!250000!0!480!360$_p3!800000!0!640!480'); $goodformat = array("", "&",'_p5!800000!0!768!576'); $m3u8 = str_replace($badformat, $goodformat, $m3u8[1]);

$hls=str_replace("http","hlsvariant://http",$m3u8); $date = date("H:i_d-m-Y"); $outputfile= $date . "-vtc8.ts";
echo "Starting livestreamer...\n\n";
		echo passthru("livestreamer  \"$hls\" best -o \"$outputfile\" &");
		echo "Done.\n";
?>
Reply With Quote