diff --git a/src/bilibili.php b/src/bilibili.php index a0f7502..30c74b6 100644 --- a/src/bilibili.php +++ b/src/bilibili.php @@ -9,11 +9,12 @@ $wf = new Workflow; -$response = request('https://s.search.bilibili.com/main/suggest?term='.urlencode($query)); -$json = json_decode($response, true); +$response = request('https://s.search.bilibili.com/main/suggest?term='.urlencode($query).'&userid='.getenv('bilibili_uid')); +$json = json_decode($response); +$results = $json->result->tag; -foreach ($json as $key => $value) { - $data = $value['value']; +foreach ($results as $sugg) { + $data = $sugg->value; $wf->result() ->title($data) ->subtitle('Search 哔哩哔哩 for '.$data) diff --git a/src/info.plist b/src/info.plist index c2e5276..7d1e7f4 100644 --- a/src/info.plist +++ b/src/info.plist @@ -1522,6 +1522,27 @@ For detailed introductions and screenshots / reporting a bug / making contributi variable proxy + + config + + default + + placeholder + + required + + trim + + + description + Your bilibili UID for personalized search suggestions of bilibili. You can find your UID at the personal information section in your personal homepage of bilibili. Leave it blank to disable personalization. + label + bilibili UID + type + textfield + variable + bilibili_uid + version 1.20