bitshare upload script

Status
Not open for further replies.

ciaociao4

Active Member
396
2011
26
0
hello

i'm looking for a new host...

i see bitshare and i have this as a part of my script

i try it but... i receive a link...
but this link don't work and give me error for delete-dmca or something else...

the file isnt in my "bitshare filemanager" too

can someone help me?

this is the function

PHP:
function upBS($value, $username, $password, $client){
$post['user'] = $username;
$post['pass'] = $password;
$post['submit'] = "Login";

$cookieFile = $client.'_BitShare.com.txt';

$lurl = "http://bitshare.com/login.html";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $lurl);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR,$cookieFile);
$result = curl_exec ($ch);
curl_close ($ch);
//echo $result;


$purl = "http://bitshare.com/";
$ch1 = curl_init();
curl_setopt($ch1, CURLOPT_URL,$purl);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch1, CURLOPT_HEADER, false);
curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch1, CURLOPT_COOKIEFILE,$cookieFile);
$result1= curl_exec ($ch1);
curl_close ($ch1);
//echo $result1;
    
    $page = $result1;
    preg_match('/<form action="(.*)" id="uploadform" method="post"/', $page, $upurl);
    $url_up = trim($upurl[1]);
    $progress_key = cut_str($page, '<input type="hidden" name="APC_UPLOAD_PROGRESS" id="progress_key"  value="','"/>');
    $usergroup_key = cut_str($page, '<input type="hidden" name="APC_UPLOAD_USERGROUP" id="usergroup_key"  value="','"/>');
    $fpost = array(    'APC_UPLOAD_PROGRESS' => $progress_key,
                    'APC_UPLOAD_USERGROUP' => $usergroup_key,
                    'UPLOAD_IDENTIFIER' => $progress_key,
                    'file[]"; filename="' => '',
                    'file[]' => "@$value");
                
    $ID = GRC();
    $upurl=$url_up.'?X-Progress-ID=undefined'.$ID.'';


$ch1 = curl_init();
curl_setopt($ch1, CURLOPT_URL,$upurl);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch1, CURLOPT_POST, 1);
curl_setopt($ch1, CURLOPT_POSTFIELDS, $fpost);
curl_setopt($ch1, CURLOPT_HEADER, TRUE);
curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch1, CURLOPT_COOKIEFILE,$cookieFile);
curl_setopt($ch1, CURLOPT_HTTPHEADER, array('Expect:')); 
$result1= curl_exec ($ch1);
curl_close ($ch1);
//echo $result1;

preg_match('%http://bitshare.com/files/(.*)%', $result1, $dlink);
preg_match('%http://bitshare.com/delete/(.*)%', $result1, $delink);

//echo ($dlink[0]."<br />".$delink[0]);
return $dlink[0];
}
 
18 comments
i can help you in making but i need time,here its night and 1:38 am now,i need to goto bed,sorry,tomorrow will do for sure,if you will need it then pm me.
 
Use Bitshare API: http://bitshare.com/openAPI.html

Edit:
Use this function if wanted to use api, Tested & Working in account
PHP:
<?php
function upBitShare($username, $password, $filepath) {
// Author: Soft2050

$post = array('user' => $username, 'password' => md5($password));
$result = sCurl('http://bitshare.com/api/openapi/login.php', $post);
$hashkey = str_replace('SUCCESS:', '', $result);

$post = array('action' => 'getFileserver');
$result = sCurl('http://bitshare.com/api/openapi/upload.php', $post);
$url = str_replace('SUCCESS:', '', $result);

$post = array('hashkey' => $hashkey,
              'file' => "@$filepath",
              'filesize' => filesize($filepath));
$result = sCurl($url, $post);

preg_match('%http://bitshare.com/files/(.*?)\.html%', $result, $downloadlink);
preg_match('%http://bitshare.com/delete/(.*?)\.html%', $result, $deletelink);

return $downloadlink[0];

}

function sCurl($url, $post) {

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec ($ch);
curl_close ($ch);

return $result;

}
?>
Usage:
PHP:
echo upBitShare('username', 'password', 'filepath');

If you wanted to anonymously upload, then send username / password as empty or a wrong combination.
 
Last edited:
<3


i take this error


Warning: filesize(): stat failed for P4IteKZD4 in /home/UTL/include/newFunctions1.php on line 445



$post = array('hashkey' => $hashkey,
'file' => "@$filepath",
(445) 'filesize' => filesize($filepath));


P4IteKZD4 is my username
 
That error generally occurs when the filepath is wrong. What is $filepath in your function? :s
Does that file exists? I hope you would be sending absolute path for upload too, Use realpath()
PHP:
echo upBitShare('username', 'password', realpath('filepath'));
 
Variable names wont make any difference since they are only used to reference in the script. You can try to replace old one with this :
PHP:
function upBitShare($username, $password, $filepath) {
// Author: Soft2050

if(!file_exists($filepath)) {
return "Error - File doesn't exists! :(";
}

$post = array('user' => $username, 'password' => md5($password));
$result = sCurl('http://bitshare.com/api/openapi/login.php', $post);
$hashkey = str_replace('SUCCESS:', '', $result);

$post = array('action' => 'getFileserver');
$result = sCurl('http://bitshare.com/api/openapi/upload.php', $post);
$url = str_replace('SUCCESS:', '', $result);

$post = array('hashkey' => $hashkey,
              'file' => "@$filepath",
              'filesize' => filesize($filepath));
$result = sCurl($url, $post);

preg_match('%http://bitshare.com/files/(.*?)\.html%', $result, $downloadlink);
preg_match('%http://bitshare.com/delete/(.*?)\.html%', $result, $deletelink);

return $downloadlink[0];

}

function sCurl($url, $post) {

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec ($ch);
curl_close ($ch);

return $result;

}
It would return a error with File doesn't exists if the path is wrong.
 
:)

PHP:
if($bitshare_username!=""){
$count = 0;
logThis($dir, "\nUploading to BitShare:", $workDir);
$BSlink = null;
while($BSlink == null){
$count++;
$BSlink = upBS($file2bupped, $bitshare_username, $bitshare_password, $client);
logThis($dir, $BSlink, $workDir);
if ($count>=5){break;}}
$bs1[] = $BSlink;}
 
Replace with:
PHP:
if($bitshare_username!=""){
$count = 0;
logThis($dir, "\nUploading to BitShare:", $workDir);
$BSlink = null;
while($BSlink == null){
$count++;
$BSlink = upBS($bitshare_username, $bitshare_password, $file2bupped);
logThis($dir, $BSlink, $workDir);
if ($count>=5){break;}}
$bs1[] = $BSlink;}

I am assuming that you have already changed the function name of upBitShare to upBS in your code.
 
a ok...thanks...i dont know there is a blacklist here too :(

then i need to change name??

it's possible to implement a random name for upload (but the real name to post in my blog) ?
 
I doubt that there blacklist would be based on the filename. More likely, it would be the md5 hash of the file.
So, just try to change the md5 hash of the file before you try to upload. You can unrar and then rerar the files back or simply add a byte at the end of a file before uploading it.
 
the script do this...unrar and rerar with a +jpg

...i think is the name


or i need to arfchive with pass... dont know how bitshare work



SOLVED !!!

NOW ALL WORK !!!

GREAT THANKS SOFT2050
 
Last edited:
Status
Not open for further replies.
Back
Top