diff options
author | Kyomotoi <[email protected]> | 2020-11-07 13:54:57 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2020-11-07 13:54:57 +0800 |
commit | 7cae371b51a14c626ce184987eea2392e15430b9 (patch) | |
tree | a35aa21a64dad59a8dc91270d78f781dbed8953d /ATRI/plugins/plugin_anime/body.py | |
parent | 11e4632aaf2be56c776dbc4e9f0ad5065bb60b5f (diff) | |
download | ATRI-7cae371b51a14c626ce184987eea2392e15430b9.tar.gz ATRI-7cae371b51a14c626ce184987eea2392e15430b9.tar.bz2 ATRI-7cae371b51a14c626ce184987eea2392e15430b9.zip |
[Update]
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 |