diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 18de6d5..d94dd85 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -293,6 +293,13 @@ class VideoDownload return popen($chain->getProcess()->getCommandLine(), 'r'); } + /** + * Get video stream from an M3U playlist. + * + * @param \stdClass $video Video object returned by getJSON + * + * @return resource popen stream + */ public function getM3uStream(\stdClass $video) { if (!shell_exec('which '.$this->config->avconv)) { @@ -312,8 +319,6 @@ class VideoDownload ] ); - //dump($procBuilder->getProcess()->getCommandLine()); die; - return popen($procBuilder->getProcess()->getCommandLine(), 'r'); } } diff --git a/controllers/FrontController.php b/controllers/FrontController.php index 5f7ef09..b357d7d 100644 --- a/controllers/FrontController.php +++ b/controllers/FrontController.php @@ -217,6 +217,15 @@ class FrontController return $response->withStatus(500); } + /** + * Get a video/audio stream piped through the server. + * @param string $url URL of the video + * @param string $format Requested format + * @param Response $response PSR-7 response + * @param Request $request PSR-7 request + * @param string $password Video password + * @return Response + */ private function getStream($url, $format, $response, $request, $password = null) { if (!isset($format)) {