Сваляне на всички намерени файлове и запазване

niksdevil

Registered
Значи, трябва ми някакси намерените файлове да ги сваля сам скрипта и да ги преименува със името на заглавието ето скрипта:
Код:
<table>
<tr>
<td>Име на клипа</td>
<td>Адрес на клипа</td>
<td>Сурц файл</td> 
</tr>

<?php
include 'simple_html_dom.php';
$html = file_get_html('http://www.videoclip.bg/category?c=10&sort=4');
foreach($html->find('a.item-title') as $row) {
        $link = 'http://www.videoclip.bg'.$row->href;        $title = $row->title;

    $video = file_get_html($link);
    $file = $video->find('source', 0);
    $image =  $video->find('meta[property=og:image]', 0)->content;
    if(is_null($file)) 
        $file = 'No video file found';
    else 
        $file = $file->src;
echo '<tr>';
    echo '<td>'. $title. ' </td> <td> <a href='. $image.'>Download</a> </td> <td> <a href='.$file.'>Download</a> </td> </tr>'.bot."\n";
}
 
Код:
<?php
include 'simple_html_dom.php';
$max_page = 30;
for($page=1;$page<=$max_page;$page++) {
$html = file_get_html('http://www.videoclip.bg/category?c=10&sort=4&page='.$page);
foreach($html->find('a.item-title') as $row) {
        $link = 'http://www.videoclip.bg'.$row->href;        $title = $row->title;

    $video = file_get_html($link);
    $file = $video->find('source', 0);
    $image =  $video->find('meta[property=og:image]', 0)->content;
    if(is_null($file)) 
        $file = 'No video file found';
    else 
        $file = $file->src;
echo '<tr>';
    echo '<td>'. $title. ' </td> <td> <a href='. $image.'>Download</a> </td> <td> <a href='.$file.'>Download</a> </td> </tr>'.bot."\n";
}
}
 

Back
Горе