used a faster version of youtube-dl(#36);fixed yt binary download issuse;cleaning up
This commit is contained in:
@@ -174,8 +174,17 @@ class Helper
|
||||
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
$result = curl_exec($ch);
|
||||
if (curl_errno($ch)) {
|
||||
$error = 'Error:' . curl_error($ch);
|
||||
}
|
||||
curl_close($ch);
|
||||
file_put_contents($file, $result);
|
||||
if (isset($error)) {
|
||||
throw new \Exception($error);
|
||||
} else {
|
||||
if (!file_put_contents($file, $result)) {
|
||||
throw new \Exception("failed to save " . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function is_function_enabled($function_name)
|
||||
|
||||
Reference in New Issue
Block a user