forked from ArdiArtani/Photo-Google-Player-Script
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgp.php
More file actions
60 lines (52 loc) · 1.63 KB
/
gp.php
File metadata and controls
60 lines (52 loc) · 1.63 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
59
60
<?php
function curl($url) {
$ch = @curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
$head[] = "Connection: keep-alive";
$head[] = "Keep-Alive: 300";
$head[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
$head[] = "Accept-Language: en-us,en;q=0.5";
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36');
curl_setopt($ch, CURLOPT_HTTPHEADER, $head);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
$page = curl_exec($ch);
curl_close($ch);
return $page;
}
function getPhotoGoogle($link){
$get = curl($link);
$data = explode('url\u003d', $get);
$url = explode('%3Dm', $data[1]);
$decode = urldecode($url[0]);
$count = count($data);
$linkDownload = array();
if($count > 2) {
$v360p = $decode.'=m18';
$linkDownload['360p'] = $v360p;
}
if($count > 3) {
$v720p = $decode.'=m22';
$v360p = $decode.'=m18';
$linkDownload['720p'] = $v720p;
$linkDownload['360p'] = $v360p;
}
if($count > 4) {
$v1080p = $decode.'=m37';
$v720p = $decode.'=m22';
$v360p = $decode.'=m18';
$linkDownload['1080p'] = $v1080p;
$linkDownload['720p'] = $v720p;
$linkDownload['360p'] = $v360p;
}
foreach ($linkDownload as $key => $l){
$files .= '{"type": "video/mp4", "label": "'.$key.'", "file": "'.$l.'"},';
}
return '['.rtrim($files, ',').']';
}
?>