Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ob_start();
- header("Content-Type: text/html;charset=utf-8");
- $uas = array(
- //Chrome
- "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13",
- "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.307.9 Safari/532.9",
- "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.1 (KHTML, like Gecko) Chrome/6.0.437.3 Safari/534.1",
- //IE
- "Mozilla/4.0 (compatible; MSIE 6.0; MSN 2.5; Windows 98)",
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)",
- "Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)",
- "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; .NET CLR 3.5.21022)",
- //Opera
- "Opera/9.02 (Windows NT 5.1; U; en)",
- "Opera/10.00 (Windows NT 6.0; U; en) Presto/2.2.0",
- "Opera/9.80 (Windows NT 5.1; U; ru) Presto/2.5.24 Version/10.52"
- );
- function checkPhotos($host, $mask, $from, $to, $right)
- {
- global $uas;
- $host = (substr($host, strlen($host)-1, 1) == '/')?($host):($host.'/');
- $links = array();
- $i = 0;
- for ($i = 0; $i <= ($to - $from); $i++)
- {
- $links[] = $host.str_replace('{NUM}', ($from+$i), $mask);
- }
- $curls = curl_multi_init();
- $threads = array();
- $results = array();
- $i = 0;
- for ($i = 0; $i < count($links); $i++)
- {
- $threads[$i] = curl_init();
- curl_setopt($threads[$i], CURLOPT_URL, $links[$i]);
- curl_setopt($threads[$i], CURLOPT_USERAGENT, $uas[rand(0, count($uas)-1)]);
- curl_setopt($threads[$i], CURLOPT_RETURNTRANSFER, true);
- curl_setopt($threads[$i], CURLOPT_HEADER, true);
- curl_setopt($threads[$i], CURLOPT_NOBODY, true);
- curl_multi_add_handle($curls, $threads[$i]);
- }
- $done = null;
- do
- {
- curl_multi_exec($curls, $done);
- }
- while ($done > 0);
- $i = 0;
- for ($i = 0; $i < count($links); $i++)
- {
- $out = curl_multi_getcontent($threads[$i]);
- if (strstr($out, trim($right)))
- {
- $results[] = $links[$i];
- }
- }
- curl_multi_close($curls);
- return $results;
- }
- ?>
- <html>
- <style>
- body
- {
- background-color:black;
- color:orange;
- margin:5%;
- font-family:verdana;
- font-size:8pt;
- }
- .inpc
- {
- border:1px solid gray;
- color:orange;
- background-color: #3D3D3D;
- padding:2px;
- font-family:verdana;
- font-size:8pt;
- }
- td
- {
- font-size:8pt;
- }
- </style>
- <body>
- <form action="" method="post">
- <table>
- <tr>
- <td>
- Хост <span style="color:gray;">(http://xxx.com/)</span>:<br>
- <input type="text" name="host" class="inpc">
- </td>
- </tr>
- <tr>
- <td>
- Маска файлов, где {NUM} - число фотографии <span style="color:gray;">(DSC_{NUM}.jpg)</span>:<br>
- <input type="text" name="mask" class="inpc">
- </td>
- </tr>
- <tr>
- <td>
- Начальное значение {NUM} <span style="color:gray;">(3400)</span>:<br>
- <input type="text" name="from" class="inpc">
- </td>
- </tr>
- <tr>
- <td>
- Конечное значение {NUM} <span style="color:gray;">(3600)</span>:<br>
- <input type="text" name="upto" class="inpc">
- </td>
- </tr>
- <tr>
- <td>
- Успешная шапка <span style="color:gray;">(Content-Type: image/jpeg)</span>:<br>
- <input type="text" name="head" class="inpc">
- </td>
- </tr>
- </table>
- <br>
- <input type="submit" value="Search" class="inpc">
- </form>
- <?php
- if (isset($_POST['host']))
- {
- $photos = checkPhotos($_POST['host'], $_POST['mask'], $_POST['from'], $_POST['upto'], $_POST['head']);
- if (count($photos) > 0)
- {
- foreach ($photos as $photo)
- {
- echo('<a href="'.$photo.'" style="text-decoration:none; color:white; margin-bottom:5px;" target="_blank">'.$photo.'</a><br>');
- }
- }
- else
- {
- echo ('Ничего не найдено');
- }
- }
- ?>
- </body>
- </html>
- <?php ob_end_flush(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement