Alltube\VideoDownload::getRtmpProcess PHP Method

getRtmpProcess() private method

Get a process that runs rtmp in order to download a video.
private getRtmpProcess ( object $video ) : Process
$video object Video object returned by youtube-dl
return Symfony\Component\Process\Process Process
    private function getRtmpProcess($video)
    {
        if (!shell_exec('which ' . $this->config->rtmpdump)) {
            throw new \Exception('Can\'t find rtmpdump');
        }
        $builder = new ProcessBuilder([$this->config->rtmpdump, '-q']);
        $builder = $this->addOptionsToRtmpProcess($builder, $video);
        if (isset($video->rtmp_conn)) {
            foreach ($video->rtmp_conn as $conn) {
                $builder->add('--conn');
                $builder->add($conn);
            }
        }
        return $builder->getProcess();
    }