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

Results 1 to 10 of 10
  1.     
    #1
    Member
    Website's:
    sborg.us

    Default [PHP] Turbobit.net Upload Function

    As requested by humour [hmmm] [meh]

    PHP Code: 
    <?php

    /** Author        : Halcyon aka V3g3t4
     *  Description   : Upload functions for turbobit.net
     *  Date          : 26-Jan-2012
     *  Copyrights    : Full rights to copy!
     */

    /*
     * All functions
     */

    /*
     * Function name : tbitLogin
     * Parameters    : username, password, cookie location
     * Returns       : True if login is successful
     */
    function tbitLogin($tbituser$tbitpass$tbitcookie) {

        
    $postURL "http://turbobit.net/user/login";
        
    $ref "http://turbobit.net/";

        
    curl($ref "lang/en/"''$tbitcookie$ref);

        
    $post['user[login]'] = $tbituser;
        
    $post['user[pass]'] = $tbitpass;
        
    $post['user[memory]'] = "on";
        
    $post['user[submit]'] = "Login";

        
    $page curl($postURL$post$tbitcookie$ref);
        
    is_present($page"forgot password?""Incorrect logins",1);

        return 
    true;
    }

    /*
     * Function name : tbitUpload
     * Parameters    : Filelocation and cookie location
     * Returns       : Download link, if successful
     */
    function tbitUpload($filelocation$tbitcookie) {

        
    $url "http://turbobit.net/";

        
    $page curl($url0$tbitcookie);

        
    preg_match('/flashvars="cancelLang=Cancel&browserLang=Add&downloadLang=Upload&maxSize=(.*?)&domain=main&urlSite=(.*?)&userId=(.*?)&apptype=(.*?)"/'$page$flashVars);

        
    $upload_url $flashVars[2];
        
    $agent 'Shockwave Flash';
        
    $data['Filename'] = basename($filelocation);
        
    $data['stype'] = 'null';
        
    $data['apptype'] = $flashVars[4];
        
    $data['user_id'] = $flashVars[3];
        
    $data['id'] = 'null';
        
    $data['Filedata'] = "@" $filelocation;

        
    $upfiles curl($upload_url$data$tbitcookie$url11$agent);
        
    preg_match('/"result":true,"id":"(.*?)","message":"Everything is ok"/'$upfiles$link);
        if (!empty(
    $link[1])) {
            
    $download_link 'http://turbobit.net/' $link[1] . '.html';
        } else {
            die(
    "Error - Unable to retrive the download link, please try again later.");
        }

        return 
    $download_link;
    }

    /*
     * Function name : is_present
     * Parameters    : String to search in, string to search and error message
     * Returns       : None
     */
    function is_present($lpage$mystr$strerror$head 0) {
        if (
    stristr($lpage$mystr)) {
            if(
    $head)
                die(
    $strerror);
            else
                echo 
    $strerror;
        }
    }

    /*
     * Function name : cut_str
     * Parametsr     : String, delimiter on the left of required output,
     *               : delimiter on the right of required output
     * Returns       : Required string
     */
    function cut_str($str$left$right) {
        
    $str substr(stristr($str$left), strlen($left));
        
    $leftLen strlen(stristr($str$right));
        
    $leftLen $leftLen ? - ($leftLen) : strlen($str);
        
    $str substr($str0$leftLen);
        return 
    $str;
    }

    /*
     * Function name : curl
     * Parameters    : Link, postfields, cookie location, referrer, true/false for
     *               : header and follow location, user agent if any
     * Returns       : Curl data or error response
     */
    function curl($link$postfields ''$cookie ''$refer ''$header 1$follow 1$usragent 0) {

        
    $ch curl_init($link);
        
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
        if (
    $header)
            
    curl_setopt($chCURLOPT_HEADER1);
        else
            
    curl_setopt($chCURLOPT_HEADER0);
        if (
    $follow)
            
    curl_setopt($chCURLOPT_FOLLOWLOCATION1);
        else
            
    curl_setopt($chCURLOPT_FOLLOWLOCATION0);

        if (
    $usragent)
            
    curl_setopt($chCURLOPT_USERAGENT$usragent);
        else
            
    curl_setopt($chCURLOPT_USERAGENT'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1');

        if (
    $refer)
            
    curl_setopt($chCURLOPT_REFERER$refer);

        if (
    $postfields) {
            
    curl_setopt($chCURLOPT_POST1);
            
    curl_setopt($chCURLOPT_POSTFIELDS$postfields);
        }
        if (
    $cookie) {
            
    curl_setopt($chCURLOPT_COOKIEJAR$cookie);
            
    curl_setopt($chCURLOPT_COOKIEFILE$cookie);
        }

        
    $page curl_exec($ch);

        
    curl_close($ch);

        if (empty(
    $page)) {
            echo 
    "<br/>Could not connect to host: <br/> $link <br/>";
        } else {
            return 
    $page;
        }
    }

    /*
     * Sample usage
     */

    $cookie    getcwd() . '/.cookie';
    $filelocation "/path/to/your/file.rar";
    $userEmail "test@turbobit.net";
    $userPass  "testPass";
    if(
    tbitLogin($userEmail$userPass$cookie)){
        echo 
    tbitUpload($filelocation$cookie);
    }

    ?>
    Halcyon Reviewed by Halcyon on . [PHP] Turbobit.net Upload Function As requested by humour <?php /** Author : Halcyon aka V3g3t4 * Description : Upload functions for turbobit.net * Date : 26-Jan-2012 * Copyrights : Full rights to copy! */ Rating: 5

    V3g3ta | Halcyon | Abhi

  2.   Sponsored Links

  3.     
    #2
    Retired NinJa
    Website's:
    loledhard.com
    THANKS FOR THIS ONE



    You don't hate Justin bieber.You hate the fact you ain't Justin Bieber!

  4.     
    #3
    Member
    Website's:
    fileservedownload.net
    very thanks halcyon (v3g3t4)


  5.     
    #4
    Member
    Website's:
    sborg.us
    Have fun [trollolol]

    V3g3ta | Halcyon | Abhi

  6.     
    #5
    Member
    Thank you, nice share.

  7.     
    #6
    Member
    Really nice share.Thanks

  8.     
    #7
    Banned
    Could not connect to host:
    http://s72.turbobit*****uploadfile
    Error - Unable to retrive the download link, please try again later.

  9.     
    #8
    Member
    Website's:
    Elite.SO Defendos.com Motionite.com
    Goodjob Ahbi.

    devNULL, why don't you debug it and find out what the issue is? Aren't you a great coder?

    Defendos BETA3 Released! Thread - Official Website

  10.     
    #9
    Banned
    lulz, i aint want spend time with this "working" code

    btw http://s69.turbobit_dot_ru/uploadfile - 405 Not Allowed

  11.     
    #10
    Member
    I think that is because you uploaded from US ip.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. PHP Upload function for sharedbit.net help
    By t3od0r in forum Web Development Area
    Replies: 2
    Last Post: 20th Oct 2012, 11:38 AM
  2. [Buying] php cURL upload function only
    By hihotfile in forum Marketplace (Buy, Sell and Trade)
    Replies: 1
    Last Post: 23rd Sep 2012, 02:27 PM
  3. Is it possible to Upload more than 1 file to Turbobit.net from my pc?
    By AlexxxMaster in forum File Host Discussion
    Replies: 4
    Last Post: 30th Jan 2012, 11:30 PM
  4. Freakshare upload function issue
    By t3od0r in forum Web Development Area
    Replies: 5
    Last Post: 30th Jan 2012, 11:26 AM
  5. [Buying] PHP Mediafire upload function
    By somik in forum Completed Transactions
    Replies: 0
    Last Post: 15th Apr 2011, 02:35 AM

Tags for this Thread

BE SOCIAL