Spaces ZO downloader

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
<?php
$page = 1;
$url = 'http://spaces.ru/shared_zone/?sid=SPACES_SID;dir=DIR_ID;p='.$page;
$res = file_get_contents($url);
preg_match_all('/<a class="gview_link" group="(.*)" shareCnt="([0-9]+)" commentCnt="([0-9]+)" dloadlink="(.*)"/ui', $res, $rs);
if($rs) {
echo "\033[32mList downloaded\033[0m\n";
for($i=0;$i<count($rs[4]);$i++) {
$type = '.jpg';
file_put_contents($i."-".mt_rand(0,999999).$type,file_get_contents($rs[4][$i]));
echo "\033[32mDownloading:\033[0m \033[35m".$i.$type."\033[0m\n";
}
}
else {
echo "\033[31mError!\033[0m\n"
}