mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-23 01:55:27 +03:00
[TwitterBridge] Enable cookies with curl (#1245)
* [TwitterBridge] Enable cookies with curl Enable cookies in curl, or fall back to `file_get_contents` if in CLI mode with no curl root certificates.
This commit is contained in:
parent
7aba7992aa
commit
50c971d545
1 changed files with 7 additions and 2 deletions
|
@ -171,9 +171,14 @@ EOD
|
|||
public function collectData(){
|
||||
$html = '';
|
||||
$page = $this->getURI();
|
||||
$cookies = $this->getCookies($page);
|
||||
|
||||
$html = getSimpleHTMLDOM($page, array("Cookie: $cookies"));
|
||||
if(php_sapi_name() === 'cli' && empty(ini_get('curl.cainfo'))) {
|
||||
$cookies = $this->getCookies($page);
|
||||
$html = getSimpleHTMLDOM($page, array("Cookie: $cookies"));
|
||||
} else {
|
||||
$html = getSimpleHTMLDOM($page, array(), array(CURLOPT_COOKIEFILE => ''));
|
||||
}
|
||||
|
||||
if(!$html) {
|
||||
switch($this->queriedContext) {
|
||||
case 'By keyword or hashtag':
|
||||
|
|
Loading…
Reference in a new issue