Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Userscloud File Importer With CURL
12-28-2015, 05:03 AM
Post: #1
Userscloud File Importer With CURL
PHP Code:
<?php

$username 
'USERSCLOUD USERNAME'// Usernama Akun Userscloud
$password 'USERSCLOUD PASSWORD'// Password Akun Userscloud
$file_url 'http://4.bp.blogspot.com/-3pkQxuWbVlM/VoB_5w3BurI/AAAAAAAABVY/LC6c_96b6ZU/s200-c/placeit.png'// URL File yang akan diimport

// Download simple_html_dom.php di http://sourceforge.net/projects/simplehtmldom/files/
include 'simple_html_dom.php';
$dom = new simple_html_dom();

$cookie dirname(__file__) . '/userscloud_cookie.txt';
$ch curl_init();
$params implode('&', array(
    
'op=login',
    
'redirect=/?',
    
'login=' $username,
    
'password=' urlencode($password),
    ));
curl_setopt($chCURLOPT_URL'https://userscloud.com/');
curl_setopt($chCURLOPT_POST1);
curl_setopt($chCURLOPT_POSTFIELDS$params);
curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
curl_setopt($chCURLOPT_SSL_VERIFYHOSTfalse);
curl_setopt($chCURLOPT_RETURNTRANSFER1);
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
curl_setopt($chCURLOPT_USERAGENT,
    
'Mozilla/5.0 (Linux; U; Android 2.3.7; en-us; Nexus One Build/GRK39F) AppleWebKit/533.1 ' .
    
'(KHTML, like Gecko) Version/4.0 Mobile Safari/533.1');
@
curl_setopt($chCURLOPT_COOKIEFILE$cookie);
curl_setopt($chCURLOPT_COOKIEJAR$cookie);
$result curl_exec($ch);
$dom->load($result);
$form $dom->find('[name="url"]'0);
$params implode('&', array(
    
'sess_id=' $form->find('[name="sess_id"]'0)->value,
    
'upload_type=url',
    
'rv_tmp_url=' urlencode($form->find('[name="srv_tmp_url"]'0)->value),
    
'url_mass=' urlencode($file_url),
    
'url_proxy=>',
    
'link_rcpt=',
    
'link_pass',
    
'to_folder=0',
    
'tos=1',
    
'submit_btn=' urlencode(' Upload! '),
    ));
$id time() . '11';
$url $form->action $id '&utype=reg&upload_type=url';
curl_setopt($chCURLOPT_URL$url);
curl_setopt($chCURLOPT_POST1);
curl_setopt($chCURLOPT_POSTFIELDS$params);
curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
curl_setopt($chCURLOPT_SSL_VERIFYHOSTfalse);
curl_setopt($chCURLOPT_RETURNTRANSFER1);
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
curl_setopt($chCURLOPT_USERAGENT,
    
'Mozilla/5.0 (Linux; U; Android 2.3.7; en-us; Nexus One Build/GRK39F) AppleWebKit/533.1 ' .
    
'(KHTML, like Gecko) Version/4.0 Mobile Safari/533.1');
curl_setopt($chCURLOPT_COOKIEFILE$cookie);
curl_setopt($chCURLOPT_COOKIEJAR$cookie);
$res curl_exec($ch);
if (
stripos($res'Status: 302 Found') !== false)
{
    
$url trim(substr($res27));
    
parse_str($url);
    
$file_url 'https://userscloud.com/' $fn;
}
curl_close($ch);

echo 
$file_url

http://sellfy.com/achunk17
Visit this user's website Find all posts by this user
Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)