The" Magic " PHP playlist

Here is the link, there is a player on the page. How do I get a playlist?

P.S. Who will load the playlist specified in the code of this page-refresh the page, I bet you won't see it the second time, but the player itself somehow still gets the playlist, the actual question is how?

Author: ReinRaus, 2012-04-03

3 answers

Here I tore out a playlist with the encoding you'll figure it out yourself. Link

 0
Author: javero, 2012-04-03 20:16:49

Exactly what you need. The code is fully working and outputs the desired playlist.

<?
header('Content-Type: text/html; charset=utf-8');
$headers="Host: video-dom2.ru\r\nAccept: */*\r\nAccept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4\r\nAccept-Charset: windows-1251,utf-8;q=0.7,*;q=0.3\r\nCache-Control: max-age=0\r\nAccept-Encoding: gzip,deflate,sdch\r\nUser-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/11.10 Chromium/17.0.963.79 Chrome/17.0.963.79 Safari/535.11\r\n";
$sock=fsockopen('video-dom2.ru', 80);
$query="GET /onlinetv/ HTTP/1.0\r\n".$headers."\r\n\r\n";
fwrite($sock, $query);
$res=fread($sock, 2048);
fclose($sock);
preg_match_all('/set-cookie: (.+?)[;\n\r]/i', $res, $arr);
$sock=fsockopen('video-dom2.ru', 80);
$query="GET /onlinetv/pl_dom2.php HTTP/1.0\r\n".$headers."Referer: http://video-dom2/onlinetv/player/player.swf\r\nCookie: ";
foreach ($arr[1] as $k=>$v){
    $query.= $v.'; ';
};
$query=substr($query, 0, strlen($query)-2);
$query.="\r\n\r\n";
fwrite($sock, $query);
$res='';
while (!feof($sock)){
    $res.=fread($sock, 512);
};
$sp=explode("\r\n\r\n", $res);
echo htmlspecialchars(gunzip($sp[1]))."\r\n";

function gunzip($zipped) {
      $offset = 0;
      if (substr($zipped,0,2) == "\x1f\x8b")
         $offset = 2;
      if (substr($zipped,$offset,1) == "\x08")  {
         return gzinflate(substr($zipped, $offset + 8));
      }
      return "Unknown Format";
}  
?>
 2
Author: ReinRaus, 2012-04-05 19:51:34

I checked it several times - it loads, but with a delay of a second. And here is the link http://video-dom2.ru/onlinetv/pl_dom2.php - there is nothing, that is, absolutely nothing, even if you look at the source code. By the way, the player does not care whether the playlist is displayed or not, for it the actual path to the playlist is registered ))

 0
Author: Deonis, 2012-04-03 19:54:47