Results 11 to 19 of 19
-
9th Feb 2012, 08:01 PM #11OPMemberWebsite's:
satiq.netWith that I scrape last upload:
PHP Code:$postdata="id=2705986&pw=password";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookiefile");
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookiefile");
curl_setopt($ch, CURLOPT_COOKIE, session_name() . '=' . session_id());
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, 'http://uploaded.to/io/login');
$result1 = curl_exec($ch);
curl_setopt($ch, CURLOPT_URL, 'http://uploaded.to/io/me/list/files');
$result2 = curl_exec($ch);
#echo str_replace("\n","<br>",$result2);
$arr=json_decode($result2,true);
echo 'http://uploaded.to/file/'.$arr['list']['0']['id'];
-
9th Feb 2012, 08:32 PM #12Member
Here is my code
PHP Code:<?php
/*
* By hover for KWWHunction. No rights reserved !
*
*/
function ultocookie ($username,$password){
$ch = curl_init("http://uploaded.to/io/login");
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies");
$ullogin = array(
'id'=>$username,
'pw'=>$password
);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $ullogin);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$result=curl_exec ($ch);
curl_close($ch);
}
function ultogetfilelink ($file){
$ch = curl_init("http://uploaded.to/io/me/list/files");
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies");
$getfilelist = array(
'page'=>'0',
'limit'=>'100',
'order'=>'date',
'dir'=>'desc',
'search'=>''
);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $getfilelist);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$result=curl_exec ($ch);
curl_close($ch);
$result = json_decode ($result,true);
foreach ($result['list'] as $key => $value)
{
if ($value['filename'] == $file)
break;
return $value['id'];
}
}
function ulftp ($file,$username,$password)
{
$name = substr ($file, strripos ($file, "/"));
$curlfscmd ="curl -T ".$file." ftp.ul.to --user ".$username.":".$password;
$succes = false;
while ($succes === false){
system ($curlfscmd,$ftpstatus);
if ($ftpstatus === 0) $succes = true;
}
//get download link (max 10 attemps, if this limit is reached we consider the upload as failed and re-upload it again
$i = 0;
$succes = false;
while ($succes === false)
{
if ( $i === 10)
break;
//sleep 30 secs before trying to get download link
sleep (30);
ultocookie($username,$password);
$fileid = ultogetfilelink($name);
unlink ("cookies");
if (isset ($fileid) === true)
{
$succes = true;
$ulto = 'http://ul.to/'.$fileid.$name;
}
else $i++;
}
return $ulto;
}
?>
PHP Code:$myultolink = ulftp ('file_path','username','password');
-
10th Feb 2012, 10:13 AM #13Member
I got this error
PHP Code:PHP Notice: Undefined variable: ulto in ul.to.php on line 82
PHP Code:return $ulto;
-
10th Feb 2012, 03:25 PM #14Member
Add this line:
PHP Code:var_dump ($result);
PHP Code:$result = json_decode ($result,true);
-
11th Feb 2012, 01:48 AM #15Member
still same error message but before that print this is from var_dump
PHP Code:[17]=>
array(11) {
["id"]=>
string(8) "*****"
["date"]=>
string(5) "1 day"
["filename"]=>
string(9) "audio.m4a"
["desc"]=>
NULL
["size"]=>
string(7) "6,71 MB"
["admin"]=>
string(12) "******"
["file_extension"]=>
string(4) ".m4a"
["dls"]=>
string(1) "0"
["lastdownload"]=>
string(12) "no entry yet"
["privacy"]=>
string(0) ""
["ddl"]=>
bool(false)
}
}
["listopts"]=>
array(4) {
["page"]=>
int(0)
["hasPrevious"]=>
bool(false)
["hasNext"]=>
bool(false)
["maxPage"]=>
int(1)
}
}
PHP Code:{"list":[{"id":"*****","date":"8 Minutes","filename":"ul.to.php","desc":null,"size":"2,19 KB","admin":"****","file_extension":".php","dls":"0","lastdownload":"no entry yet","privacy":"","ddl":false}],"listopts":{"page":0,"hasPrevious":false,"hasNext":true,"maxPage":18}}
-
11th Feb 2012, 05:31 PM #16Member
Did your uploaded file's name appear in the var_dump output?
-
12th Feb 2012, 12:35 AM #17Member
no, can't find it
after the script upload the file, the scrape seem difficult to find the file until it reach 10 times of 30s because it wait very long until the script finish
-
12th Feb 2012, 02:25 AM #18Member
Does the file you're trying to upload has a name containing any chars other than alphanumeric ?
-
12th Feb 2012, 07:05 AM #19Member
no, just simple alphanumeric
any way, how about other that tried the script.....?
Are you successful?
Please testimony in here
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Uploaded.to Discussion - Post your discussions related to Uploaded here.
By Update in forum File Host DiscussionReplies: 66Last Post: 11th Jul 2012, 02:46 PM -
Uploaded.to Discussion Topic - Post all uploaded.to related discussions here!
By Mindy in forum File Host DiscussionReplies: 1994Last Post: 5th Mar 2012, 02:14 PM -
Fileserve cURL changes
By _brazzO in forum Web Development AreaReplies: 44Last Post: 25th Oct 2011, 07:56 AM -
Curl IPB help
By xwarlordx in forum Web Development AreaReplies: 3Last Post: 23rd Aug 2011, 06:33 AM -
cURL Pro Coders.
By kohkindachi in forum Completed TransactionsReplies: 2Last Post: 5th Dec 2010, 12:30 AM
themaCreator - create posts from...
Version 3.24 released. Open older version (or...