Alltube\VideoDownload::getCurlProcess PHP Method

getCurlProcess() private method

Get a process that runs curl in order to download a video.
private getCurlProcess ( object $video ) : Process
$video object Video object returned by youtube-dl
return Symfony\Component\Process\Process Process
    private function getCurlProcess($video)
    {
        if (!shell_exec('which ' . $this->config->curl)) {
            throw new \Exception('Can\'t find curl');
        }
        $builder = ProcessBuilder::create(array_merge([$this->config->curl, '--silent', '--location', '--user-agent', $video->http_headers->{'User-Agent'}, $video->url], $this->config->curl_params));
        return $builder->getProcess();
    }