mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-05 10:34:55 +02:00
fix: various small fixes (#3578)
This commit is contained in:
parent
11ce8b5dcd
commit
701fe3cfed
13 changed files with 87 additions and 39 deletions
|
@ -490,18 +490,22 @@ class VkBridge extends BridgeAbstract
|
|||
|
||||
private function getContents()
|
||||
{
|
||||
$header = ['Accept-language: en', 'Cookie: remixlang=3'];
|
||||
$httpHeaders = [
|
||||
'Accept-language: en',
|
||||
'Cookie: remixlang=3',
|
||||
];
|
||||
$redirects = 0;
|
||||
$uri = $this->getURI();
|
||||
|
||||
while ($redirects < 2) {
|
||||
$response = getContents($uri, $header, [CURLOPT_FOLLOWLOCATION => false], true);
|
||||
$response = getContents($uri, $httpHeaders, [CURLOPT_FOLLOWLOCATION => false], true);
|
||||
|
||||
if (in_array($response['code'], [200, 304])) {
|
||||
return $response['content'];
|
||||
}
|
||||
|
||||
$uri = urljoin(self::URI, $response['header']['location'][0]);
|
||||
$headers = $response['headers'];
|
||||
$uri = urljoin(self::URI, $headers['location'][0]);
|
||||
|
||||
if (str_contains($uri, '/429.html')) {
|
||||
returnServerError('VK responded "Too many requests"');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue