1
0
Fork 0
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:
Myned 2019-09-24 20:05:18 -04:00
parent e51c5615d8
commit 884f101ad4
No known key found for this signature in database
GPG key ID: BC58C09870A63E59

View file

@ -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'
} }