-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·33 lines (26 loc) · 1014 Bytes
/
index.php
File metadata and controls
executable file
·33 lines (26 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
require('simplehtmldom/simple_html_dom.php');
function searchImages($url) {
$context = stream_context_create(array(
'http' => array(
'header' => array('User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; rv:2.2) Gecko/20110201'),
),
));
# create directory to download images
$urlTreated = preg_replace('/[^\d-]/i', '', $url);
mkdir("t" . $urlTreated, 0777, true);
chdir("t" . $urlTreated);
# get html of url and download images
$html = file_get_html($url, false, $context);
foreach($html->find('img') as $element) {
$elementPure = $element->src;
$elementTreated = substr($elementPure, 2);
$elementTreated = str_replace("s.", ".", $elementTreated);
exec("wget $elementTreated");
}
}
echo "===================================\n";
echo " DOWNLOAD IMAGES with PHP7\n 4CHAN\n";
echo "===================================\n";
$url = readline("[-] Thread link: ");
searchImages($url);