-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.php
More file actions
32 lines (29 loc) · 733 Bytes
/
server.php
File metadata and controls
32 lines (29 loc) · 733 Bytes
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
<?php
header( 'X-Robots-Tag: none' );
function url_get_contents($url) {
if (!function_exists('curl_init')){
die('CURL is not installed!');
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
if (isset($_GET['url'])) {
if ($_GET['url']==null || !$_GET['url']) {
$file = "URL undefined!";
} else {
$url = $_GET['url'];
$file = file_get_contents($url);
if ($file==null || !$file) {
$file = url_get_contents($url);
}
header('Content-type: video');
}
} else {
$file = "URL undefined!";
}
echo $file;
?>