Better way to get user agent string
This commit is contained in:
parent
1bdfcbeb09
commit
c92ea929a4
1 changed files with 2 additions and 3 deletions
|
@ -115,10 +115,9 @@ class FrontController
|
|||
$video = $this->download->getJSON($params["url"]);
|
||||
|
||||
//Vimeo needs a correct user-agent
|
||||
$UA = $this->download->getUA();
|
||||
ini_set(
|
||||
'user_agent',
|
||||
$UA
|
||||
$video->http_headers->{'User-Agent'}
|
||||
);
|
||||
$url_info = parse_url($video->url);
|
||||
if ($url_info['scheme'] == 'rtmp') {
|
||||
|
@ -161,7 +160,7 @@ class FrontController
|
|||
header("Content-Type: audio/mpeg");
|
||||
passthru(
|
||||
'curl '.$this->config->curl_params.
|
||||
' --user-agent '.escapeshellarg($UA).
|
||||
' --user-agent '.escapeshellarg($video->http_headers->{'User-Agent'}).
|
||||
' '.escapeshellarg($video->url).
|
||||
' | '.$this->config->avconv.
|
||||
' -v quiet -i - -f mp3 -vn pipe:1'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue