Activity Stream
48,167 MEMBERS
62592 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 3 of 3
  1.     
    #1
    Member

    Default Simple download from RS & extract

    I download movies to remote upload to moviehosts.

    I used to use command line to do it all, but got around to making it easier

    I made a simple script that
    • Downloads RS links.
    • Extracts rar's
    • Deletes orignal .rar's and Junk files
    • Displays finished movie file URL


    Create a folder & CMOD to 777

    http://www.g-loaded.eu/2010/10/04/rs...apidshare-api/
    save the py script to rs.py (enter your RS premium details in config)



    Save the following to index.php
    PHP Code: 
    <?
        $files 
    glob("{*.avi,*.mkv,*.mp4}"GLOB_BRACE); 
        foreach(
    $files as $file)
            {
            echo 
    "<a href='".substr("http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."",0,-9)."$file'>$file</a><br />";
            } 

        if(empty(
    $_POST))
            {
            
    ?>
                RS links<br /><form method="post" action=""><textarea name="links" style="width:400px;height:250px;"></textarea><br/><input type="submit" value="Submit"/></form>
            <?
            
    }    else    {
            
    $links = array();
            
    preg_match_all("/http:\/\/rapidshare\.com\/files\/[0-9A-Za-z]+\/[-_.0-9A-Za-z]+/i"$_POST['links'], $matchesPREG_SET_ORDER);
            foreach(
    $matches as $link)
                {
                
    $links[] = $link[0];
                
    $filename getfilename($link[0]);
                echo 
    "Downloading : ".$filename."<br />";
                
    shell_exec("python rs.py " $link[0] . "");
                }
            echo 
    "<br />Extracting<br />";
            
    $filename getfilename($link[0]);
            
    shell_exec("rar e " $filename "");
            echo 
    "Done - Deleting rars<br />";
            foreach(
    $matches as $link)
                {
                
    $links[] = $link[0];
                
    $filename getfilename($link[0]);
                
    unlink($filename);
                }

            
    $files glob("{*.txt,*.url,*.nfo,*.jpg}"GLOB_BRACE); 
            foreach(
    $files as $file)
                {
                
    unlink($file);
                }     
            echo 
    "Finished";
        }

            function 
    getfilename($link)
            {
              
    $startpos strripos($link"/");
              
    $endpos strlen($link);
              
    $theid substr($link, ($startpos 1), ($endpos $startpos));
              return 
    $theid;
            }
    ?>
    Gavo Reviewed by Gavo on . Simple download from RS & extract I download movies to remote upload to moviehosts. I used to use command line to do it all, but got around to making it easier :) I made a simple script that Downloads RS links. Extracts rar's Deletes orignal .rar's and Junk files Displays finished movie file URL Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    You can make this even smaller by removing your getfilename() function and using basename() instead

  4.     
    #3
    Member
    I checked out basename when i was making it, but couldnt be bothered to see how it handled special chars etc, so used the function I had

    I updated it a bit to remove more junk files and list completed movies

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. FileDownloads.org - Simple Pay-Per-Download Program
    By FileHosting in forum File Hosts Official Support
    Replies: 505
    Last Post: 17th Nov 2012, 01:00 PM
  2. extract tar
    By accyuklad in forum Server Management
    Replies: 2
    Last Post: 5th Oct 2011, 08:48 AM
  3. tar.gz extract
    By praveer in forum Technical Help Desk Support
    Replies: 7
    Last Post: 30th Jul 2011, 05:11 PM
  4. sSKKa's New Simple Download Buttons
    By sSKKa in forum Graphics Area
    Replies: 23
    Last Post: 10th Apr 2011, 12:16 PM
  5. Simple Download Bars (PSD Inc.)
    By Ezeh in forum Graphics Area
    Replies: 4
    Last Post: 7th Nov 2010, 05:14 PM

Tags for this Thread

BE SOCIAL