Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function getLinkInfos($code, $key)
- {
- $sequence_number = mt_rand(1,99999999999);
- $ch = curl_init("https://g.api.mega.co.nz/cs?id=".$sequence_number);
- $data = array(array("a" => "g", "p" => $code));
- $data_string = json_encode($data);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
- curl_setopt($ch, CURLOPT_VERBOSE, 1);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
- $output = curl_exec($ch);
- $res = json_decode(curl_exec($ch),true);
- if(!isset($res[0]['s']) || !isset($res[0]['at']))
- {
- return false;
- }
- else
- {
- $key = base64_decode($key);
- $size = $res[0]['s'];
- $name = $res[0]['at'];
- // HOW TO DECRYPT "at" ?
- return array('size' => $size,
- 'name' => $name );
- }
- }
- var_dump(getLinkInfos('KRgBQCaI', 'ay8OYmRbLSIokMioDWRPKjcdZDFNrubHZiMVqinNUmI'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement