Просмотр поста

.
kiberpank
вот рабочий вариан граба ... тут тока заменил регулярку с условием .
<?php
define('_IN_JOHNCMS', 1);
$textl = 'test';
require_once('../incfiles/core.php');
require_once('../incfiles/head.php');
function parse($url) {
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT , 'kiberpank');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
$file = curl_exec($ch);
curl_close($ch);
return $file;
}

$page = $_GET['page'];
if(preg_match('#^download/[0-9]*/[a-z0-9]*/#is', $page))
{
header('Location: http://iceload.ru/films/&#039;.$page);
exit;
}

$file = parse('http://iceload.ru/films/'. (!empty($page) ? $page : ''));

$file = preg_replace('#<a href="http://iceload.ru/films/(.*?)">(.*?)</a>#is', '<a href="?page=$1">$2</a>', $file);

$file= str_replace('<?xml version="1.0" encoding="UTF-8"?>', '', $file);
$file= preg_replace('|<div class="title">(.*?)</div>|is','',$file);
$file= preg_replace('|<sсript>(.*?)</sсript>|is','',$file);

$file= preg_replace('|<div class="foot">(.*?)</div>|is','',$file);
$file= preg_replace('|<h1>(.*?)<h1>|is','',$file);
$file= preg_replace('|<script type="text/(.*?)">(.*?)</sсript>|is','',$file);

$file= preg_replace('|<!DOCTYPE(.*?)<body>|is', '',$file);

$file= preg_replace('|<head>(.*?)</head>|is','',$file);
echo $file;
require_once('../incfiles/end.php');
?>