mirror of
https://github.com/myned/modufur.git
synced 2024-12-25 06:37:29 +00:00
Remove preference for e621, change wording to match other uses
This commit is contained in:
parent
e51c5615d8
commit
884f101ad4
1 changed files with 10 additions and 11 deletions
|
@ -72,23 +72,22 @@ async def query_saucenao(url):
|
||||||
params={'url': url, 'api_key': u.config['saucenao_api'], 'output_type': 2},
|
params={'url': url, 'api_key': u.config['saucenao_api'], 'output_type': 2},
|
||||||
json=True)
|
json=True)
|
||||||
|
|
||||||
results = content['results'][0]
|
match = content['results'][0]
|
||||||
for i in range(len(content['results'])):
|
|
||||||
if 'e621' in content['results'][i]['header']['index_name']:
|
|
||||||
results = content['results'][i]
|
|
||||||
|
|
||||||
if 'author_name' in results['data']:
|
if 'author_name' in match['data']:
|
||||||
artist = 'author_name'
|
artist = 'author_name'
|
||||||
elif 'member_name' in results['data']:
|
elif 'member_name' in match['data']:
|
||||||
artist = 'member_name'
|
artist = 'member_name'
|
||||||
else:
|
elif 'creator' in match['data']:
|
||||||
artist = 'creator'
|
artist = 'creator'
|
||||||
|
else:
|
||||||
|
artist = 'imdb_id'
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
'source': results['data']['ext_urls'][0],
|
'source': match['data']['ext_urls'][0],
|
||||||
'artist': results['data'][artist],
|
'artist': match['data'][artist],
|
||||||
'thumbnail': results['header']['thumbnail'],
|
'thumbnail': match['header']['thumbnail'],
|
||||||
'similarity': str(int(float(results['header']['similarity']))),
|
'similarity': str(int(float(match['header']['similarity']))),
|
||||||
'database': 'SauceNAO'
|
'database': 'SauceNAO'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue