-
Notifications
You must be signed in to change notification settings - Fork 3
/
class_allembed.php
70 lines (70 loc) · 2.56 KB
/
class_allembed.php
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
59
60
61
62
63
64
65
66
67
68
69
70
<?php
class embed{
private function post_url($url, $body){
$ch = @curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if($body != null){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
}
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5000);
$page = curl_exec($ch);
curl_close($ch);
return $page;
}
private function link_upload($link, $name){
if (preg_match('@https?://(?:[\w\-]+\.)*(?:drive|docs)\.google\.com/(?:(?:folderview|open|uc)\?(?:[\w\-\%]+=[\w\-\%]*&)*id=|(?:folder|file|document|presentation)/d/|spreadsheet/ccc\?(?:[\w\-\%]+=[\w\-\%]*&)*key=)([\w\-]{28,})@i', $link, $id)) {
$links = "http://cdn.dldramaid.xyz:5000/mirror/".$id[1]."/".$name;
}
return $links;
}
private function rapidvideo($link){
$link = json_decode($this->post_url($link, null),true);
if ($link[status] == "OK"){
$url = $link["sources"][0]["file"];
$result_curl= $this->post_url("http://api.rapidvideo.com/v1/remote.php?ac=add&user_id=8091&url=".$url, null);
$result = $this->get_idupload($result_curl);
}
return $result;
}
private function openload($link){
$link = json_decode($this->post_url($link, null),true);
if ($link[status] == "OK"){
$url = $link["sources"][0]["file"];
$result_curl= $this->post_url("http://api.openload.co/1/remotedl/add","login=1c6d666055b6a4c0&key=t5EK0UYI&url=".$url);
$result = $this->get_idupload($result_curl);
}
return $result;
}
private function get_idupload($result){
$link = json_decode($result,true);
if ($link[status] == "200"){
$result_id="upload_id=".$link[result][id];
}
return $result_id;
}
public function iframesd($url, $name){
$url_upload = $this->link_upload($url, $name);
$url_upload= $this->rapidvideo($url_upload);
return $url_upload;
}
public function iframehd($url, $name){
$url_upload = $this->link_upload($url, $name);
$url_upload= $this->openload($url_upload);
return $url_upload;
}
public function check_openload($url){
$id_upload = str_replace("upload_id=","",$url);
$result_curl= $this->post_url("http://api.openload.co/1/remotedl/status","login=1c6d666055b6a4c0&key=t5EK0UYI&id=".$id_upload, null);
$id = json_decode($result_curl,true);
return $id[result][$id_upload][extid];
}
public function check_rapidvideo($url){
$id_upload = str_replace("upload_id=","",$url);
$result_curl= $this->post_url("http://api.rapidvideo.com/v1/remote.php?ac=check&user_id=8091&remote_id=".$id_upload, null);
$id = json_decode($result_curl,true);
return $id[result][object_code];
}
}
?>