forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurl2Embed.json.php
41 lines (34 loc) · 1.03 KB
/
url2Embed.json.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
<?php
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
header('Content-Type: application/json');
$obj = new stdClass();
$obj->error = true;
$obj->msg = "";
$obj->url = @$_REQUEST['url'];
$obj->embed = "";
$obj->playLink = "";
$obj->playEmbedLink = "";
if (!isValidURL($obj->url)) {
$obj->msg = "URL is invalid";
die(json_encode($obj));
}
$obj->error = false;
$obj->embed = parseVideos($obj->url, 1);
$evideo = new stdClass();
$evideo->videos_id = 0;
$evideo->videoLink = $obj->url;
$evideo->title = "";
$evideo->description = "";
$evideo->webSiteRootURL = $global['webSiteRootURL'];
$evideo->thumbnails = false;
$evideo->poster = false;
$evideo->filename = "";
$evideo->type = 'embed';
$evideo->users_id = User::getId();
$evideo->thumbnails = false;
$evideo->thumbnails = false;
$obj->playLink = "{$global['webSiteRootURL']}evideo/" . encryptString(json_encode($evideo));
$obj->playEmbedLink = "{$global['webSiteRootURL']}evideoEmbed/" . encryptString(json_encode($evideo));
die(json_encode($obj));