From 74e39ac1ad1ec292557816bd9c517ad671594bc4 Mon Sep 17 00:00:00 2001
From: Tufayel Ahmed <39314838+TufayelLUS@users.noreply.github.com>
Date: Fri, 2 Oct 2020 14:44:18 +0600
Subject: [PATCH] Watermarked videos will download locally to serve
Enabled local download feature is back again with jQuery ajax request service. Currently in the testing phase for performance checkup.
---
index.php | 34 ++++++++++++++++++++++++++++++----
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/index.php b/index.php
index c4808aa..ad8917a 100644
--- a/index.php
+++ b/index.php
@@ -1,6 +1,6 @@
$video_url,
CURLOPT_RETURNTRANSFER => true,
@@ -48,6 +48,20 @@ function downloadVideo($video_url, $geturl = false)
return $filename;
}
+if (isset($_GET['url']) && !empty($_GET['url'])) {
+ if ($_SERVER['HTTP_REFERER'] != "") {
+ $url = $_GET['url'];
+ $name = downloadVideo($url);
+ echo $name;
+ exit();
+ }
+ else
+ {
+ echo "";
+ exit();
+ }
+}
+
function getContent($url, $geturl = false)
{
$ch = curl_init();
@@ -190,7 +204,19 @@ function getContent($url, $geturl = false)
mkdir("user_videos");
}
if ($store_locally){
- $filename = downloadVideo($contentURL);
+ ?>
+
+