]> _ Git - cubeextranet.git/commitdiff
done #2302 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 17 Oct 2018 09:32:58 +0000 (09:32 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 17 Oct 2018 09:32:58 +0000 (09:32 +0000)
inc/commons/class.common.tools.php

index fcd43f81a44f9d7c3cd54faf7a8d303c51f2a693..4826833167749482ed564a80a315d3dccd0e2186 100644 (file)
@@ -1190,4 +1190,20 @@ class commonTools
                cubeHTTP::relayFile($f);
                exit;
        }
+
+       public static function youtubedl()
+       {
+               $url = $_GET['url'];
+               $dir = '/data/extranet/www/cache/youtubedl';
+               `cd $dir;youtube-dl $url`;
+               $fname=trim(`youtube-dl --get-filename $url`);
+               $path = $dir . '/' . $fname;
+
+
+               header('Content-Type: application/octet-stream');
+               header('Content-Disposition: attachment; filename="'.$fname.'"');
+               header('X-SendFile: '.$path);
+               ob_end_clean();
+               exit;
+       }
 }