-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload.php
More file actions
58 lines (53 loc) · 1.65 KB
/
upload.php
File metadata and controls
58 lines (53 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
$login='yourloginapi';
$key='yourloginKey';
function remoteAdd($url){
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.openload.co/1/remotedl/add?login=".$login."&key=".$key."&url=".$url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
return $response;
}
function cekRemoteUpload($id){
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.openload.co/1/remotedl/status?login=".$login."&key=".$key."&id=".$id,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
return $response;
}
function renameFile($fileId,$newName){
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.openload.co/1/file/rename?login=".$login."&key=".$key."&file=".$fileId."&name=".$newName,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
return json_decode($response,true)['msg'];
}
?>