Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/bin/php
- <?php
- srand();
- function is_load_complete(){
- for ($page=1;$page<=12000;$page++){
- if (!file_exists('dmp-'.$page.'.html')){return false;}
- }
- return true;
- }
- function load_page($interface_id){
- global $interfaces;
- $i=mt_rand(1,12000);
- while (file_exists('dmp-'.$i.'.html')){
- $i=mt_rand(1,12000);
- }
- system('wget "http://anidb.net/perl-bin/animedb.pl?show=anime&aid='.$i.'" -O dmp-'.$i.'.html.gz --tries=10 --timeout=60 '.
- '--user-agent="'.$interfaces[$interface_id]->useragent.'" '.
- '--bind-address '.$interfaces[$interface_id]->ip.' '.
- '--referer="http://anidb.net/" '.
- '--cookies=on --keep-session-cookies --save-cookies=anidb_cookies_'.$interface_id.'.txt');
- @unlink('dmp-'.$i.'.html');
- if (filesize('dmp-'.$i.'.html.gz')<1000){
- echo "\nAttention! Site does not respond!";
- $interfaces[$interface_id]->next=time()+300;
- return;
- }
- system('gunzip dmp-'.$i.'.html.gz');
- $buf=file_get_contents('dmp-'.$i.'.html');
- if (preg_match('|YOU HAVE BEEN AUTO-BANNED|', $buf)){
- @unlink('dmp-'.$i.'.html');
- echo "\nAttention! We was banned!";
- $interfaces[$interface_id]->next=time()+12*3600;
- return;
- }
- if (mt_rand(0,10)==0){
- $interfaces[$interface_id]->next=time()+mt_rand(30,40);
- }else{
- $interfaces[$interface_id]->next=time()+mt_rand(2,5);
- }
- }
- function load_page_test($interface_id){
- global $interfaces;
- echo "\n".$interface_id;
- for ($i=0;$i<3;$i++){echo '.';sleep(1);}
- $interfaces[$interface_id]->next=time()+mt_rand(2,5);
- }
- $useragents=array(
- 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36',
- 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0',
- 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko',
- 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.41 Safari/537.36',
- 'Mozilla/5.0 (iPad; CPU OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53',
- 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36',
- 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0',
- 'Mozilla/5.0 (iPad; CPU OS 7_0_3 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) CriOS/30.0.1599.16 Mobile/11B511 Safari/8536.25',
- 'Opera/9.80 (Windows NT 6.0; Edition Yx 01) Presto/2.12.388 Version/12.16',
- 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36',
- 'Mozilla/5.0 (iPad; CPU OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) CriOS/31.0.1650.18 Mobile/11B554a Safari/8536.25',
- 'Mozilla/4.0 (compatible; MSIE 6.0; Update a; AOL 6.0; Windows 98)',
- 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36',
- 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)',
- 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2)',
- 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.5 (KHTML, like Gecko) YaBrowser/1.1.1084.5409 Chrome/19.1.1084.5409 Safari/536.5',
- 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 OPR/18.0.1284.68',
- 'Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0',
- 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1761.0 Safari/537.36',
- 'Opera/9.80 (Windows NT 6.1; Edition Yx 01) Presto/2.12.388 Version/12.16',
- 'Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9Z999',
- 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.5 (KHTML, like Gecko) YaBrowser/1.1.1084.5409 Chrome/19.1.1084.5409 Safari/536.5',
- 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; MRA 6.0 (build 5993); MRA 8.0 (build 5784); InfoPath.2)',
- 'Opera/9.80 (Windows NT 5.1; Distribution 00) Presto/2.12.388 Version/12.16',
- 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1230.0 Safari/537.1',
- 'Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
- 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.12124 YaBrowser/13.12.1599.12124 Safari/537.36',
- 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
- 'Mozilla/5.0 (Windows NT 6.1; rv:27.0) Gecko/20100101 Firefox/27.0',
- 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 YaBrowser/13.10.1500.9323 Safari/537.36',
- 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.0.3705)',
- );
- $interfaces=array(
- (object)array('ip'=>'', 'next'=>0, 'useragent'=>$useragents[mt_rand(0, count($useragents)-1)] ),
- (object)array('ip'=>'', 'next'=>0, 'useragent'=>$useragents[mt_rand(0, count($useragents)-1)] ),
- (object)array('ip'=>'', 'next'=>0, 'useragent'=>$useragents[mt_rand(0, count($useragents)-1)] ),
- (object)array('ip'=>'', 'next'=>0, 'useragent'=>$useragents[mt_rand(0, count($useragents)-1)] ),
- (object)array('ip'=>'','next'=>0, 'useragent'=>$useragents[mt_rand(0, count($useragents)-1)] ),
- (object)array('ip'=>'', 'next'=>0, 'useragent'=>$useragents[mt_rand(0, count($useragents)-1)] ),
- (object)array('ip'=>'', 'next'=>0, 'useragent'=>$useragents[mt_rand(0, count($useragents)-1)] ),
- (object)array('ip'=>'', 'next'=>0, 'useragent'=>$useragents[mt_rand(0, count($useragents)-1)] )
- );
- print_r($interfaces);
- for (;!is_load_complete();){
- $interface_id=-1;
- for ($i=mt_rand(0,count($interfaces)-1);
- $interface_id==-1;
- $i=mt_rand(0,count($interfaces)-1)){
- if ($interfaces[$i]->next<=time()){
- $interface_id=$i;
- break;
- }
- }
- if ($interface_id==-1){
- echo "\nThere is no interfaces at all";
- sleep(1);
- continue;
- }
- load_page($interface_id);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement