From: vincent@cubedesigners.com Date: Wed, 17 Oct 2018 09:32:58 +0000 (+0000) Subject: done #2302 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=18f07a66c7e4559ea6f38431077936dee5c29717;p=cubeextranet.git done #2302 @0.5 --- diff --git a/inc/commons/class.common.tools.php b/inc/commons/class.common.tools.php index fcd43f81a..482683316 100644 --- a/inc/commons/class.common.tools.php +++ b/inc/commons/class.common.tools.php @@ -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; + } }