Thread: playtv.fr
View Single Post
  #11  
Old 05-30-2015, 02:10 AM
biezom biezom is offline
Senior Member
 
Join Date: Sep 2014
Posts: 1,025
biezom is on a distinguished road
Default

Re: playtv.fr


Quote:
Originally Posted by mk123 View Post
can somebody help me with this script please , im new to this but i learn verry fast.
where i should save this script and how i can make it work or how can i use it

thanks again.
php script

on linux create beblack-caribbean.php

Code:
<?php
$url="http://playtv.fr/television/beblack-caribbean/";

$link=str_replace("television/","player/play/",$url)."?bitrate=0&format=hls&language=fr";

$m3u8=json_decode(file_get_contents($link))->url;

echo "Starting ffmpeg...\n\n";
	echo shell_exec("ffmpeg -ss 10  -i  '$m3u8' -c copy beblack-caribbean.ts &");
	echo "Done.\n";
?>

on windows (probably an easier way is possible)

create beblack-caribbean.bat

Code:
@ echo on
call php beblack-caribbean.php
call set /p m3u8b= <m3u8.txt
call ffmpeg -ss 10 -i "%m3u8b%" -c copy beblack-caribbean.ts
pause
:end
and create beblack-caribbean.php

Code:
<?php
$url="http://playtv.fr/television/beblack-caribbean/";

$link=str_replace("television/","player/play/",$url)."?bitrate=0&format=hls&language=fr";

$m3u8=json_decode(file_get_contents($link))->url;

$Fnm = "m3u8.txt"; $inF = fopen($Fnm,"w"); fputs($inF,"$m3u8");
fclose($inF); 
?>
of course you must have php an ffmpeg

if you want with some change it's possible to add date and time for the output file
example 2015-05-30_10-33-52beblack-caribbean.ts

Last edited by biezom : 05-30-2015 at 05:01 AM. Reason: add -ss 10 option for ffmpeg
Reply With Quote