Userscloud Import File Menggunakan CURL
<?php
$username = 'USERSCLOUD USERNAME'; // Usernama Akun Userscloud
$password = 'USERSCLOUD PASSWORD'; // Password Akun Userscloud
$file_url = 'https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYm43eXa9ExGgeIb56bwCvKZRabDOvGWzgv66QbMpLUNyj5eFdcTxhBQ9JsgGx2CzmoGUGH1K0q8tfvfbRQOPwHElWbtpcKlfXcl5aIqedr52jSRGU2sd8bZzxmtCt7XABBXUNZXTkY5o/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($ch, CURLOPT_URL, 'https://userscloud.com/');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_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($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_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($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_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($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
$res = curl_exec($ch);
if (stripos($res, 'Status: 302 Found') !== false)
{
$url = trim(substr($res, 27));
parse_str($url);
$file_url = 'https://userscloud.com/' . $fn;
}
curl_close($ch);
echo $file_url;
Pemasangan di mana?
BalasHapusnice, tool yang bermanfaat,kunjungi juga : Iweblogsite
BalasHapus