|
|
|
@ -11,8 +11,8 @@ class PremiumizeMe { |
|
|
|
static function getLink($url) { |
|
|
|
$fields = [ |
|
|
|
'method' => 'directdownloadlink', |
|
|
|
'params[login]' => getenv('PREM_LOGIN'), |
|
|
|
'params[pass]' => getenv('PREM_PASS'), |
|
|
|
'params[login]' => getenv('PREM_CID'), |
|
|
|
'params[pass]' => getenv('PREM_PIN'), |
|
|
|
'params[link]' => $url |
|
|
|
]; |
|
|
|
$httpFields = http_build_query($fields); |
|
|
|
@ -48,25 +48,33 @@ class PremiumizeMe { |
|
|
|
* |
|
|
|
* @return array[string]mixed |
|
|
|
*/ |
|
|
|
static function getStatus() { |
|
|
|
static function getStatus() { |
|
|
|
# TODO : https://app.swaggerhub.com/apis/premiumize.me/api/1.0.0#/account/accountInfo
|
|
|
|
# TODO : https://blog.premiumize.me/old-api-phaseout-new-api-changes-and-best-practices-for-the-cache/
|
|
|
|
# TODO : All requests must include either parameters customer_id and pin (both located at www.premiumize.me/account)
|
|
|
|
$fields = [ |
|
|
|
'method' => 'accountstatus', |
|
|
|
'params[login]' => getenv('PREM_LOGIN'), |
|
|
|
'params[pass]' => getenv('PREM_PASS') |
|
|
|
'customer_id' => getenv('PREM_CID'), |
|
|
|
'pin' => getenv('PREM_PIN') |
|
|
|
]; |
|
|
|
$httpFields = http_build_query($fields); |
|
|
|
|
|
|
|
$ch = curl_init(); |
|
|
|
curl_setopt($ch, CURLOPT_URL, 'http://api.premiumize.me/pm-api/v1.php?'.$httpFields); |
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
|
|
|
curl_setopt($ch, CURLOPT_URL, 'https://www.premiumize.me/api/account/info'); |
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
|
|
|
curl_setopt($ch, CURLOPT_POST, 1); |
|
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); |
|
|
|
|
|
|
|
$curlResult = curl_exec($ch); |
|
|
|
curl_close($ch); |
|
|
|
$data = json_decode($curlResult); |
|
|
|
$data = json_decode($curlResult); |
|
|
|
|
|
|
|
var_dump($data); |
|
|
|
|
|
|
|
$retour = get_object_vars($data->result); |
|
|
|
$tmpDT = new DateTime(); |
|
|
|
$tmpDT->setTimestamp($retour['expires']); |
|
|
|
$retour['expires'] = $tmpDT; |
|
|
|
$retour['expires'] = $tmpDT; |
|
|
|
var_dump($retour); |
|
|
|
exit(); |
|
|
|
return $retour; |
|
|
|
} |
|
|
|
|
|
|
|
|