feat: add limit options to the slowest bridges

This commit is contained in:
dag 2022-04-10 18:56:24 +02:00 committed by GitHub
parent 0b40f51c01
commit 5a733b3d82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 80 additions and 20 deletions

View file

@ -17,7 +17,8 @@ class UnogsBridge extends BridgeAbstract {
'What\'s New' => 'new last 7 days',
'Expiring' => 'expiring'
)
)
),
'limit' => self::LIMIT,
),
'Global' => array(),
'Country' => array(
@ -160,8 +161,17 @@ EOD;
break;
}
$api_url = self::URI . '/api/search?query=' . urlencode($feed)
. ($country_code ? '&countrylist=' . $country_code : '') . '&limit=30';
$limit = $this->getInput('limit') ?? 30;
// https://rapidapi.com/unogs/api/unogsng/details
$api_url = sprintf(
'%s/api/search?query=%s%s&limit=%s',
self::URI,
urlencode($feed),
$country_code ? '&countrylist=' . $country_code : '',
$limit
);
$json_data = $this->getJSON($api_url);
$movies = $json_data['results'];