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

[KemonoBridge] Add search query support (#4620)

This commit is contained in:
July
2025-08-03 18:16:14 -04:00
committed by GitHub
parent 3835f290c1
commit e394be7ca5

View File

@@ -24,6 +24,11 @@ class KemonoBridge extends BridgeAbstract
'name' => 'User ID/Name', 'name' => 'User ID/Name',
'exampleValue' => '9069743', # Thomas Joy 'exampleValue' => '9069743', # Thomas Joy
'required' => true, 'required' => true,
],
'q' => [
'name' => 'Search query',
'exampleValue' => 'classic',
'required' => false,
] ]
]]; ]];
@@ -33,13 +38,17 @@ class KemonoBridge extends BridgeAbstract
{ {
$api = parent::getURI() . 'api/v1/'; $api = parent::getURI() . 'api/v1/';
$url = $api . $this->getInput('service') . '/user/' . $this->getInput('user'); $url = $api . $this->getInput('service') . '/user/' . $this->getInput('user');
$api_response = getContents($url . '/profile');
$profile = Json::decode($api_response);
$this->title = ucfirst($profile['name']);
if ($this->getInput('q')) {
$url .= '?q=' . urlencode($this->getInput('q'));
}
$api_response = getContents($url); $api_response = getContents($url);
$json = Json::decode($api_response); $json = Json::decode($api_response);
$url .= '/profile';
$api_response = getContents($url);
$profile = Json::decode($api_response);
$this->title = ucfirst($profile['name']);
foreach ($json as $element) { foreach ($json as $element) {
$item = []; $item = [];