Вопрос про граб,

419
.
Мастер 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
.
jaras, Так то тебе парсер нужен
.
вот попробуй
$file = str_replace('erovideo.mobi/save.php?id=', 'save.php?id=', $file);

Внутри save.php
$id = intval($_GET['id']);
$url = 'http://erovideo.mobi/save.php?id='.$id;
$get = get_headers($url, 1);
foreach($get as $t => $k){
header($t.': '.$k);
}
header('Content-Disposition: attachment; filename='.$_SERVER['HTP_HOST'].'_'.basename($get['Location']));
readfile($get['Location']);
.
# alibek_kz (03.01.2014 / 20:50)
Внутри save.php
[php]
$id = intval($_GET['id']);
$url = 'http://erovideo.mobi/save.php?id='.$id;
$get = get_headers($url, 1);
foreach($get as $t => $k){
header($t.': '.$k);
}
header('Content-D
Ne pashet http://honwo.ru/videoxxx/
.
Мастер PHP
bushidO, Нет грабопарсер грабит страницы а файлы парсит
.
Мастер PHP
alibek_kz, Не пашет
.
# jaras (04.01.2014 / 15:35)
alibek_kz, Не пашет
$id = intval($_GET['id']);
$url = 'http://erovideo.mobi/save.php?id='.$id;
$get = get_headers($url, 1);
foreach($get as $t => $k){
if($t != 'Location'){
header($t.': '.$k);
}
}
header('Content-Disposition: attachment; filename='.$_SERVER['HTP_HOST'].'_'.basename($get['Location']));
readfile($get['Location']);
.
$id = intval($_GET['id']);
$url = 'http://erovideo.mobi/save.php?id='.$id;
$get_file_url = get_headers($url, 1);
$get = get_headers($get_file_url['Location'], 1);
foreach($get as $t => $k){
header($t.': '.$k);
}
header('Content-Disposition: attachment; filename='.$_SERVER['HTP_HOST'].'_'.basename($get['Location']));
readfile($get['Location']);
.
Мастер PHP
alibek_kz, Источник заменился но при сохронение файла точнее скачке вес файла 0кб
.
как вырезать вниз ? http://choyhonada.tk/dl
Всего: 10