Alltube\VideoDownload::getProp PHP Method

getProp() private method

Get a property from youtube-dl.
private getProp ( string $url, string $format = null, string $prop = 'dump-json' ) : string
$url string URL to parse
$format string Format
$prop string Property
return string
    private function getProp($url, $format = null, $prop = 'dump-json')
    {
        $this->procBuilder->setArguments(['--' . $prop, $url]);
        if (isset($format)) {
            $this->procBuilder->add('-f ' . $format);
        }
        $process = $this->procBuilder->getProcess();
        $process->run();
        if (!$process->isSuccessful()) {
            throw new \Exception($process->getErrorOutput());
        } else {
            return $process->getOutput();
        }
    }