diff options
Diffstat (limited to 'ATRI/plugins/plugin_anime/body.py')
-rw-r--r-- | ATRI/plugins/plugin_anime/body.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ATRI/plugins/plugin_anime/body.py b/ATRI/plugins/plugin_anime/body.py index 00ee4ec..a68dc48 100644 --- a/ATRI/plugins/plugin_anime/body.py +++ b/ATRI/plugins/plugin_anime/body.py @@ -15,9 +15,16 @@ import json from utils.utils_error import errorRepo from utils.utils_request import request_get -class SauceNAO: - def __init__(self, api_key, output_type=2, testmode=0, dbmask=None, dbmaski=32768, db=5, numres=1): +class SauceNAO: + def __init__(self, + api_key, + output_type=2, + testmode=0, + dbmask=None, + dbmaski=32768, + db=5, + numres=1): api = 'https://saucenao.com/search.php' self.api = api params = dict() @@ -34,6 +41,7 @@ class SauceNAO: self.params['url'] = url return request_get(self.api, self.params) + def resultRepo(user: str, key: str, img_url: str): try: task = SauceNAO(key) @@ -57,6 +65,6 @@ def resultRepo(user: str, key: str, img_url: str): msg0 += f"Pic URL: https://pixiv.cat/{data['data'].get('pixiv_id', None)}.jpg" if float(data['header'].get('similarity', 0)) < 65: - msg0 += '注:相似率小于65%不一定正确' - + msg0 += '\n注:相似率小于65%不一定正确' + return msg0
\ No newline at end of file |