Some Thing Else File Copy Script Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Some Thing Else File Copy Script Help

    Hello friends i have lots of files on files folder .i want to search a file that contains string like bollywood . and copy that files in to files/bollywood folder .How can i do ?
    Please help something else .Thanks in advance.

    #2
    just use a modded version of this: http://coding-talk.com/f16/something...grabber-10106/
    eg:
    open bollywood folder ....and put this script in it:
    PHP Code:
    <?
    //====================================================================================================//
    //                         Site Crawler File Grabber v1.0                                             //
    //  Scripted By:                                                                                      //
    //          _________                      __  .__    .__                                             //
    //         /   _____/ ____   _____   _____/  |_|  |__ |__| ____    ____                               //
    //         \_____  \ /  _ \ /     \_/ __ \   __\  |  \|  |/    \  / ___\                              //
    //         /        (  <_> )  Y Y  \  ___/|  | |   Y  \  |   |  \/ /_/  >                             //
    //        /_______  /\____/|__|_|  /\___  >__| |___|  /__|___|  /\___  /                              //
    //                \/             \/     \/          \/        \//_____/                               //
    //                        ___________.__                                                              //
    //                        \_   _____/|  |   ______ ____                                               //
    //                         |    __)_ |  |  /  ___// __ \                                              //
    //                         |        \|  |__\___ \\  ___/                                              //
    //                        /_______  /|____/____  >\___  >                                             //
    //                                \/           \/     \/    (Something Else @ http://coding-talk.com) //
    //                                                                                                    //
    //   Did You Remember To Thank Me For This? or give me rep?                                           //
    //   Thank Me And I More Likely To Release More Scipts.                                               //
    //                                                                                                    //
    //                                 Somthing Else 2011 ©                                               //
    //====================================================================================================//

    //uncomment these 2 lines for debugging ;)
    //error_reporting  (E_ALL);
    //ini_set ('display_errors', true);

    //SQL
    /* 
    CREATE TABLE `something_else` (
      `id` int(100) NOT NULL auto_increment,
      `url` varchar(255),
      `link` varchar(255),
      `type` int(1) NOT NULL default '1',
      PRIMARY KEY  (`id`),
      UNIQUE KEY `url` (`url`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
    */

    ////////////////////////////////SETTINGS

    $file = './files/'; //location for files to be uploaded

    $search = array(".zip",".rar",".gif", ".png", ".jpg", ".jpeg", ".mp3", ".wav", ".mp4", ".sis", ".jar", ".3gp", ".nth", ".thm", ".amr", ".sisx", ".mid", ".jad");  //What file formats to search for

    $page = array(".php",".asp",".htm",".html"); //page formats to search for more links.

    $maxfiles = 50; // max files to be grabbed at 1 time

    $allow = false; // Allow crawler to crawl to other site links 

    $host = ""; //database host
    $user = ""; //database user
    $pass = ""; //database pass
    $name = ""; //database name

    $baseimage = "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAARCACWAJYDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD7LooooAKK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YP8A4qgD5yH7EPhbHPjjWc/9esVL/wAMQ+Fv+h41n/wFir6M/wCFh+AP+h48M/8Ag1g/+Ko/4WH4A/6Hjwz/AODWD/4qgD5z/wCGIfC3/Q8az/4CxVxXxg/Y7uvDXhC98QeEPEk2sSWETTz2NzbBJJI1GWMbKcFgATtI57HOAfsQePfApGR408OY/wCwpD/8VXF/GT43eAPBvgbUr2PxLpGp6i9u6WVjaXaTyTSlSFBCk7Uz1Y8AZ6nAIByf7DnxRufHnw5n0HVvK/tTw35VtvjQIJbZlIibAwMjYynH90Hqa+g6+Pv+Cbfhm/t9L8U+LbiJ47O8eGytSRgSGPe0hHqBuQZ9dw7V9g0AFFFFABRRRQAUUUUAFFFFABWF438HeGPG2jNpHirRbTVbMnISdOUP95GGGRvdSDW7RQB8ueJ/2KvAd9cvNoXiTW9IVjnyZAlyi+y5Ctj6saw/+GHNK/6KJef+Ctf/AI5X1/RQB8gf8MOaV/0US8/8Fa//AByj/hhzSv8Aool5/wCCtf8A45X1/RQB8gf8MOaV/wBFEvP/AAVr/wDHKP8AhhzSv+iiXn/grX/45X1/RQB8en9hvT88fEe6/wDBQv8A8drV8M/sTeErPUo59f8AF+qatbIwJt4bZbYP7M25jj6YPuK+raKAKHh7RtK8PaLaaLoljDYadZxiK3t4VwqKP85JPJJJPNX6KKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/9k=";
    //base64 image 

    ////////////////////////////////END SETTINGS
    if($_GET['stc']==''){ 
    $part = explode('/',$_POST['link']);
    $stc = $part[2];
    }else $stc = $_GET['stc'];
    ?>
    <html>
    <head>
    <title>Something Else Site Crawler File Grabber v1.0</title>
    <script type="text/javascript">
    function reload()
    {
    window.location = "<?=$_SERVER["PHP_SELF"]?>?crawl=1&stc=<?=$stc?>"
    }
    </script>
    </head>
    <body>
    <center>
    <h3>Something Else Site Crawler File Grabber v1.0</h3>
    <br/>
    <form action="<?=$_SERVER["PHP_SELF"]?>" method="post">
    Site Url: <input type="text" name="link"/><br/>
    <input type="submit" value="Submit"/>
    </form>
    <br/><br/>
    <?

    if($pass){
    mysql_connect($host,$user,$pass);
    mysql_select_db($name);
    }else{
    echo 'Please Update Settings in Script<br/>';
    }

    //////////////////////////////FUNCTIONS

    /////////////////////////////Get Links
    function getLinks($link){
      $page = file_get_contents($link);
      $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
      if(preg_match_all("/$regexp/siU", $page, $match, PREG_SET_ORDER)) {
      $a = 0;
      $ret = array();
      foreach($match as $tag){
              $ret[$a] = $tag[2];
              $a++;
        }
      return $ret;
       }
    }

    /////////////////////////////grab files from page
    function grabfiles($link,$urls,$search,$file,$maxfiles,$page,$baseimage,$stc,$allow){
    echo "Grabbing From: $link<br/>";
    if(substr($link,-1)!='/'){
    $parts = explode('/',$link);
    $nop = count($parts)-1;
    $link = '';
    for ($i = 0; $i <= $nop; $i++) {
        $link.=$parts[$i].'/';
    }
    }

    if(sizeof($urls) > $maxfiles){
    foreach($urls as $key){
    if(substr_count($key,$stc)<1&&$allow==false) $key = $link;

    $find = str_replace($search, '|',strtolower($key));
    if(substr_count($find,'|')>0) $type = 1;
    else $type = 2;
    if($key=="/") $key = $link;
    mysql_query("INSERT INTO something_else SET page='".$link."', url='".$key."', type='".$type."'");
    }

    //load page
    echo "<img src=\"data:imagejpg;base64,$baseimage\" alt=\"\" onload=\"setTimeout(reload(),10000)\"/>";


    }else if(sizeof($urls) > 0)
        {
            foreach($urls as $key)
            {
                      
             $pages = str_replace($page, '|',strtolower($key));

               $find = str_replace($search, '|',strtolower($key));
               if(substr_count($find,'|')>0)
                 {
                     if(substr_count($key,'http')<1)
                      $key = $link.$key;

                        $ice = explode('/',$key);
                        $num = count($ice)-1;
                         if(substr_count($ice[$num],"bollywood")>0){
                         if(copy($key, $file.$ice[$num])) 
                            echo 'Copyied <a href="'.$file.$ice[$num].'">'.$ice[$num].' </a> Successfully<br/>';
                         else
                            echo 'Could Not Copy '.$ice[$num].'<br/>';
                            }

                          

                  }
                  else if(substr_count($pages,'|')>0||substr($key,-1)=='/')
                  {
                     if($key=="/") $key = $link;
                     if(substr_count($key,"http://")<1)
                     $key = $link.$key;
                     mysql_query("INSERT INTO something_else SET link='".$link."', url='".$key."', type='2'");
                  }
                  
                   
            }

          $call = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM something_else"));
          if($call[0]!=0){
          echo "<img src=\"data:imagejpg;base64,$baseimage\" alt=\"\" onload=\"setTimeout(reload(),10000)\"/>";
                         } 
        }else{
            echo "No links found<br/>";
     echo "<img src=\"data:imagejpg;base64,$baseimage\" alt=\"\" onload=\"setTimeout(reload(),10000)\"/>";
        }


    }


    ////////////////////////////////MAIN SCRIPT


    if(!is_dir($file)) mkdir($file);

    $link = $_POST['link'];

    if($link){
        $urls = getLinks($link);
        grabfiles($link,$urls,$search,$file,$maxfiles,$page,$baseimage,$stc,$allow);
        
        $call = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM something_else"));
        if($call[0]!=0){
       echo "<img src=\"data:imagejpg;base64,$baseimage\" alt=\"\" onload=\"setTimeout(reload(),10000)\"/>";
        }
    }


    ///////////////////////crawl
    if($_GET['crawl']){
    $call = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM something_else WHERE type='1'"));

    if($call[0]>0){
    $xurls = mysql_query("SELECT url, id FROM something_else WHERE type='1' LIMIT $maxlinks");
    $urls = array();
    $n = 0;
    while ($url = mysql_fetch_array($xurls))
        {
     $urls[$n] = $item[0];
     $n++;
    mysql_query("UPDATE something_else SET type='0' WHERE id='".$item[1]."'");
        }

    grabfiles($link,$urls,$search,$file,$maxfiles,$page,$baseimage,$stc,$allow);

                  }else{

    $call = mysql_fetch_array(mysql_query("SELECT url, id FROM something_else WHERE type='2'"));
    if($call[0]!=""){
        mysql_query("UPDATE something_else SET type='0' WHERE id='".$call[1]."'");
        $urls = getLinks($call[0]);
        grabfiles($call[0],$urls,$search,$file,$maxfiles,$page,$baseimage,$stc,$allow);  

     }else{
    mysql_query("DELETE FROM something_else WHERE id!='0'");
    echo "Grabbing complete =D<br/>";
    }
    }

    }

    ?>

    </center>
    </body>
    </html>

    Comment


      #3
      Please give me above code in zip

      Comment

      Working...
      X