Audio/video stream recording forums
|
Attention Visitor: |
You may have to register or log in before you can post:
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to auto extract m3u8 and auto start recordingIs 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 ! |
#2
|
|||
|
|||
Re: How to auto extract m3u8 and auto start recordingQuote:
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"; ?> |
#3
|
|||
|
|||
Re: How to auto extract m3u8 and auto start recordinghi, the code you posted assumes livestreamer is in the same dir as php.exe, so I had to edit the path for livestreamer.
BUT how do u hard-interrupt the recording (force stop it)? Ctrl + C gives an error Code:
php recme1.php Warning: date(): It is not safe to rely on the system's timezone settings. You a re *required* to use the date.timezone setting or the date_default_timezone_set( ) function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the ti mezone 'UTC' for now, but please set date.timezone to select your timezone. in C :\php\recme1.php on line 4 Starting livestreamer... [download][..0-09-2015-hanoi-cab2.ts] Written 5.0 MB (32s @ 158.3 KB/s) T raceback (most recent call last): File "<string>", line 6, in <module> File "__main__.py", line 128, in <module> ^C File "__main__livestreamer__.py", line 9, in <module> c:\php>^X File "livestreamer_cli\main.py", line 890, in main File "livestreamer_cli\console.py", line 45, in msg IOError: [Errno 22] Invalid argument |
#4
|
|||
|
|||
Re: How to auto extract m3u8 and auto start recordingQuote:
PHP.ini and save it in php folder to interrupt recording Ctrl+C several times or close command prompt i think if you want to make task schedule you can create .bat file like this Code:
@ echo on call "C:\PHP\php.exe" "C:\php-scripts\recme1.php" pause :end |
#5
|
|||
|
|||
Re: How to auto extract m3u8 and auto start recordingThanks Biezom
What about this: Code:
http://vuapp.tranvu.info/#tivi/173 Code:
http://vuapp.tranvu.info/api/channel/getnexttv?channel=5h503z5s5058553n5a6n786a5u715a765j3n5q6o6v6k5a46435z594759576z5d5h3c585ed645920e395fedad7bbbed0eca3fe2e05s56&token=313434313935333134385f305f305f776562&mobile=0 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 Code:
http://125.212.201.169:1935/liveedge/_definst_/amlst:$vtc8$stream$_p5!800000!0!768!576/playlist.m3u8?data=b00c5416ba2f281c2f01319e9e5e2d0236777e07b597de3ffd7bac0a06f5af0da96175989dd7e573ce85f6aac805a4ea&expired=1443608952362 |
#6
|
|||
|
|||
Re: How to auto extract m3u8 and auto start recordingQuote:
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"; ?> |
Tags: m3u8 |
Thread Tools | |
Display Modes | |
|
|