-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcallyoutube.php
More file actions
55 lines (40 loc) · 912 Bytes
/
callyoutube.php
File metadata and controls
55 lines (40 loc) · 912 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
include 'hardware.php';
class CallYoutube {
public $serverAddress;
public function __construct() {
$MacAdd = new Hardware();
$this->serverAddress = $MacAdd->getServerAddress();
}
public function getYoutubeLink() {
$MacAdd = new Hardware();
$macAddress = $macAdd->getMyMacAdd();
if($macAddress != false)
{
$hashMacAdd = $this->hashMyMacAdd($macAddress);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $this->serverAddress.'/stream/start?hash='.$hashMacAdd);
curl_setopt($curl, CURLOPT_HEADER, 0);
$response = curl_exec($curl);
$code = curl_getinfo($curl,CURLINFO_HTTP_CODE);
curl_close($curl);
if($code == '500')
{
echo 'Error';
exit;
}
else
{
echo substr($response,0,strlen($response)-1);
return;
}
}
else
{
exit;
}
}
}
$Stream = new CallYoutube();
$Stream->getYoutubeLink();
?>