Results 1 to 10 of 10
-
26th Jan 2012, 06:11 PM #1OPMemberWebsite's:
sborg.us[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($url, 0, $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, $url, 1, 1, $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($str, 0, $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($ch, CURLOPT_RETURNTRANSFER, 1);
if ($header)
curl_setopt($ch, CURLOPT_HEADER, 1);
else
curl_setopt($ch, CURLOPT_HEADER, 0);
if ($follow)
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
else
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
if ($usragent)
curl_setopt($ch, CURLOPT_USERAGENT, $usragent);
else
curl_setopt($ch, CURLOPT_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($ch, CURLOPT_REFERER, $refer);
if ($postfields) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
}
if ($cookie) {
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_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
-
26th Jan 2012, 06:19 PM #2Retired NinJaWebsite's:
loledhard.comTHANKS FOR THIS ONE
You don't hate Justin bieber.You hate the fact you ain't Justin Bieber!
-
26th Jan 2012, 11:04 PM #3MemberWebsite's:
fileservedownload.netvery thanks halcyon (v3g3t4)
-
27th Jan 2012, 01:05 AM #4OPMemberWebsite's:
sborg.usHave fun [trollolol]
V3g3ta | Halcyon | Abhi
-
27th Jan 2012, 08:45 AM #5Member
Thank you, nice share.
-
6th Feb 2012, 10:15 AM #6Member
Really nice share.Thanks
-
10th Feb 2012, 07:59 AM #7Banned
Could not connect to host:
http://s72.turbobit*****uploadfile
Error - Unable to retrive the download link, please try again later.
-
10th Feb 2012, 08:39 AM #8MemberWebsite's:
Elite.SO Defendos.com Motionite.comGoodjob Ahbi.
devNULL, why don't you debug it and find out what the issue is? Aren't you a great coder?
-
10th Feb 2012, 09:20 AM #9Banned
lulz, i aint want spend time with this "working" code
btw http://s69.turbobit_dot_ru/uploadfile - 405 Not Allowed
-
10th Feb 2012, 09:59 AM #10Member
I think that is because you uploaded from US ip.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
PHP Upload function for sharedbit.net help
By t3od0r in forum Web Development AreaReplies: 2Last Post: 20th Oct 2012, 11:38 AM -
[Buying] php cURL upload function only
By hihotfile in forum Marketplace (Buy, Sell and Trade)Replies: 1Last Post: 23rd Sep 2012, 02:27 PM -
Is it possible to Upload more than 1 file to Turbobit.net from my pc?
By AlexxxMaster in forum File Host DiscussionReplies: 4Last Post: 30th Jan 2012, 11:30 PM -
Freakshare upload function issue
By t3od0r in forum Web Development AreaReplies: 5Last Post: 30th Jan 2012, 11:26 AM -
[Buying] PHP Mediafire upload function
By somik in forum Completed TransactionsReplies: 0Last Post: 15th Apr 2011, 02:35 AM
themaManager - edit and manage...
Version 4.04 released. Open older version (or...