1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-11 11:04:36 +02:00

feat: extract curl ua to config value (#2568)

* exclude config.default.ini.php from phpcs
This commit is contained in:
dag
2022-04-03 09:37:39 +02:00
committed by GitHub
parent 42788cd3ee
commit bed20e9f28
9 changed files with 9 additions and 21 deletions

View File

@@ -229,7 +229,7 @@ EOD
$ctx = stream_context_create(array(
'http' => array(
'user_agent' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0',
'user_agent' => Configuration::getConfig('http', 'useragent'),
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
)
)
@@ -254,7 +254,7 @@ EOD
$context = stream_context_create(array(
'http' => array(
'user_agent' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0',
'user_agent' => Configuration::getConfig('http', 'useragent'),
'header' => 'Cookie: ' . $cookies
)
)

View File

@@ -25,8 +25,6 @@ class MixCloudBridge extends BridgeAbstract {
}
public function collectData(){
ini_set('user_agent', 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0');
$html = getSimpleHTMLDOM(self::URI . '/' . $this->getInput('u'));
foreach($html->find('section.card') as $element) {

View File

@@ -409,8 +409,6 @@ class VkBridge extends BridgeAbstract
private function getContents()
{
ini_set('user-agent', 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0');
$header = array('Accept-language: en', 'Cookie: remixlang=3');
return getContents($this->getURI(), $header);

View File

@@ -41,9 +41,6 @@ class WebfailBridge extends BridgeAbstract {
}
public function collectData(){
ini_set('user_agent', 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0');
$html = getSimpleHTMLDOM($this->getURI() . $this->getInput('type'));
$type = array_search($this->getInput('type'),

View File

@@ -47,7 +47,8 @@ class ZoneTelechargementBridge extends BridgeAbstract {
$header = array();
// Parse the URL to extract the hostname
$parse = parse_url($url);
$opts = array(CURLOPT_USERAGENT => 'curl/7.64.0',
$opts = array(
CURLOPT_USERAGENT => Configuration::getConfig('http', 'useragent'),
CURLOPT_RESOLVE => $this->getResolve($parse['host'])
);