aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2020-12-11 23:37:14 -0500
committerJesús <heckyel@hyperbola.info>2020-12-11 23:37:14 -0500
commit6d735abe0a59204477346d7fa873a384eb55afee (patch)
treeda39f0f082a8d36c38963954f36f3c8c6934cb86 /tools
parent4306feebc05a2946eeff332314f151d96a39be39 (diff)
downloadytlibre-6d735abe0a59204477346d7fa873a384eb55afee.tar.lz
ytlibre-6d735abe0a59204477346d7fa873a384eb55afee.tar.xz
ytlibre-6d735abe0a59204477346d7fa873a384eb55afee.zip
Renew sig file after 60 sec
Diffstat (limited to 'tools')
-rw-r--r--tools/extract.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/extract.php b/tools/extract.php
index 97cad90..4d52852 100644
--- a/tools/extract.php
+++ b/tools/extract.php
@@ -2,6 +2,14 @@
$id = $video_id;
+// Delete sig file if is old 60 sec
+if (is_file(TOOLS_PATH.'sig.php')) {
+ $filelastmodified = filemtime(TOOLS_PATH.'sig.php');
+ if((time() - $filelastmodified) > 60) {
+ unlink(TOOLS_PATH.'sig.php');
+ }
+}
+
function getc($url) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip');