Alltube\VideoDownload::getCurlProcess PHP 메소드

getCurlProcess() 개인적인 메소드

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
리턴 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();
    }