X-Forward einsetzen

tekzen

Mitglied
Hallo,

die Seite von TRT2 lässt sich per x forward abspielgen, wie es über php geht habe ich nicht rausfinden können,

Code:
[code]<item>
  <title>TRT Spor 2</title>
  <inputstream>$doregex[url]|User-Agent=iPad&X-Forwarded-For=176.54.83.142</inputstream>
  <thumbnail>https://www.trtspor.com.tr/static/img/trtspor-logo-yeni.png</thumbnail>
  <regex>
    <name>url</name>
    <expres>src:\s*'([^']+)</expres>
    <page>https://www.trtspor.com.tr/canli-yayin-izle/trt-spor-2/</page>
    <x-forward>176.54.83.142</x-forward>
  </regex>
</item>


hab versucht aus dem was geht die php zu erstellen leider fehlerhaft




Code:
<?php
function fakeip()
{
//return long2ip( mt_rand(0, 65537) * mt_rand(0, 65535) );
return "127.0.0.1";
}
function curlx($feed,$coo=null,$ref=null)
{

$ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $feed);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("REMOTE_ADDR: ".fakeip(),"X-Client-IP: ".fakeip(),"Client-IP: ".fakeip(),"HTTP_X_FORWARDED_FOR: ".fakeip(),"X-Forwarded-For: ".fakeip()));
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0');
//curl_setopt($ch, CURLOPT_INTERFACE, "88.150.225.55");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
if(!empty($coo))
{
curl_setopt($ch, CURLOPT_COOKIEFILE, $coo);
curl_setopt($ch, CURLOPT_COOKIEJAR, $coo);
}
if(empty($ref))
{
curl_setopt($ch, CURLOPT_REFERER,$feed);
}
else
{
curl_setopt($ch, CURLOPT_REFERER,$ref);
}
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$veri= curl_exec($ch);
curl_close($ch);
return str_replace(array("\n", "\t", "\r",), null, $veri);
}

//
$html = file_get_contents("http://www.trtspor.com.tr/canli-yayin-izle/trt-spor-2/");


preg_match_all(
    '/(http.*m3u8)/',

    $html,
    $posts,
    PREG_SET_ORDER
);

foreach ($posts as $post) {
    $link = $post[0];
$link = str_replace("playlist.m3u8","chunklist_w140710217.m3u8",$link);
header("Location: $link");
}

?>
 
Zurück