[UnogsBridge] Better feed title for Country context (#2279)

This commit is contained in:
csisoap 2021-09-28 16:20:04 +07:00 committed by GitHub
parent 42e40e2823
commit cb111a3ebd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,7 +74,7 @@ class UnogsBridge extends BridgeAbstract {
if($this->queriedContext == 'Global') {
$feedName .= 'Netflix Global - ';
} elseif($this->queriedContext == 'Country') {
$feedName .= 'Netflix Country Code: ' . $this->getInput('country_code') . ' - ';
$feedName .= 'Netflix ' . $this->getParametersKey('country_code') . ' - ';
}
if($this->getInput('feed') == 'expiring') {
$feedName .= 'Expiring title';
@ -86,6 +86,20 @@ class UnogsBridge extends BridgeAbstract {
return $feedName;
}
private function getParametersKey($input = '') {
$params = $this->getParameters();
$tab = 'Country';
if (!isset($params[$tab][$input])) {
return '';
}
return array_search(
$this->getInput($input),
$params[$tab][$input]['values']
);
}
private function getJSON($url) {
$header = array(
'Referer: https://unogs.com/',