3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://80.211.175.169:7112/22.php"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = "User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.4; Lenovo P90 Build/S100)"; $headers[] = "Host: swiftstreamz.com"; $headers[] = "Content-Encoding: gzip"; $headers[] = "Connection: Keep-Alive"; $headers[] = "Authorization: Basic QFN3aWZ0MTExIzpAU3dpZnQxMTEj"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $res = curl_exec($ch); $package = json_decode($res,true); $package = $package['#EXTM3U']; $f = fopen('links.php','w'); $p = fopen('playlist.m3u','w'); fwrite($f,"<?php\n\$url = array(\n"); fwrite($p,"#EXTM3U\n"); foreach ($package as $id ) { $url = "http://80.211.175.169:7112/22.php".$id['cid']; curl_setopt($ch, CURLOPT_URL,$url ); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 2); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = "User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.4; Lenovo P90 Build/S100)"; $headers[] = "Host: swiftstreamz.com"; $headers[] = "Content-Encoding: gzip"; $headers[] = "Connection: Keep-Alive"; $headers[] = "Authorization: Basic QFN3aWZ0MTExIzpAU3dpZnQxMTEj"; $res = json_decode(curl_exec($ch),true); $res = $res['#EXTM3U']; foreach ($res as $channel) { $chann = str_replace (" ","",$channel['channel_title']); $stream = $channel['channel_url']; $cn = str_replace (" ","",$channel['category_name'])."_"; if (strpos($stream,".mp4") !== false ) { echo "skip video $chann\n"; } else { $login =""; $password =""; curl_setopt($ch, CURLOPT_URL, "http://80.211.175.169:7112/22.php"); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 2); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, "$login:$password"); $headers = array(); $headers[] = "User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.4; Lenovo P90 Build/S100)"; $headers[] = "Host: 80.211.175.169:7112"; $headers[] = "Content-Encoding: gzip"; $headers[] = "Content-Type: text/html"; $headers[] = "Connection: Keep-Alive"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $token = curl_exec($ch); curl_setopt($ch, CURLOPT_URL,$stream.$token ); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); $res = curl_exec($ch); if((strpos($res,"Forbidden") !== false) || is_null($res) || empty($res) ) { echo "skip invalid token $cn$chann\n"; } else { fwrite($f,"'$cn$chann' => '$stream',\n"); fwrite($p,"#EXTINF:-1,".$cn.$chann."\n"); fwrite($p,"http://80.211.175.169:7112/".$cn.$chann.".m3u8\n"); } } } } fwrite($f,");");

preferences:
51.24 ms | 402 KiB | 5 Q