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

.
jaras
Мастер PHP

Вот в чём вопрос нужно сделать вот так
Допустим у меня в моём сайте есть один граббер видео с erovideo.mobi
сам код

function cache($text){
$time = 86400;
$cache = 'cache/'.md5($_SERVER['REQUEST_URI']);
if(file_exists($cache) && time() - filemtime($cache) < $time){
echo file_get_contents($cache);
}else{
file_put_contents($cache,$text);
echo $text;
}
}

$file = file_get_contents ( 'http://erovideo.mobi/?' . $_SERVER [ 'QUERY_STRING' ]);
$file = preg_replace ( '|</head><body><div class="obnova2">(.*?)Лучшие|is' , '' , $file );
$file = preg_replace ( '|</head><body><div class="obnova2">(.*?)Видео|is' , '' , $file );
$file = preg_replace ( '|<div class="niz">(.*?)</body>|is' , '' , $file );
$file = preg_replace ( '|<!DOCTYPE html PUBLIC(.*?)<br/></div><div class="row">|is' , '' , $file );
$file = preg_replace ( '|<!DOCTYPE html PUBLIC(.*?)<div class="main"><div class="obnova1">|is' , '' , $file );
$file = preg_replace ( '|<a href="./save.php?id=(.*?)">Скачать</a>|is' , '<a href="http://erovideo.mobi/save.php?id=(.*?)">Скачать</a>' , $file );
$file = str_replace ( '<img src="./screens/' , '<img src="http://erovideo.mobi/screens/' , $file );
$file = str_replace ( 'ads.waprik@mail.ru' , '' , $file );
$file = str_replace ( '<a href="./save.php' ,  '<a href="http://erovideo.mobi/save.php' ,  $file );
$file = str_replace ( '<a href="./?' ,  '<a href="./index.php?' ,  $file );
$file = str_replace ( '- <a href' ,  '&#187; <a href' ,  $file );
$file = str_replace ( '</div><div class="obnova2">' ,  '<br/>' ,  $file );
$file = str_replace ( '<div class="row">' ,  '<div class="rb">' ,  $file );
$file = preg_replace ( '|, добавлен(.*?)<br/>|is' , '<br/>' , $file );
$file = str_replace ( '&#187;' ,  '</div><div class="menu"></strong> <img
src="http://maxabat.ru/i/folder.png" alt=""><strong>' ,  $file );
$file = str_replace ( '<img src="http://erovideo.mobi/screens/' ,  '<div><div class="menu"><img src="http://erovideo.mobi/screens/' ,  $file );
$file = str_replace ( 'screen" /><br/></div><div class="menu">' ,  'screen" /><br/>' ,  $file );
$file = str_replace ( 'Видео "<b>' ,  '<div class="title">Видео "<b>' ,  $file );
$file = str_replace ( '<div class="obnova1">' ,  '<div class="foot">' ,  $file );
$file = str_replace ( '<div class="rb"><br/>' ,  '<div class="menu">Страница: ' ,  $file );

echo cache($file);

Мне нужно сделать чтобы при скачке файла
http://erovideo.mobi/save.php?id=1
изменилось на это
http://мой сайт/save.php?id=24182
и мой коперайт при сохранение файла
мой сайт_имя файла.3gp