mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 21:02:38 +00:00
Add back e621 preference, refactor artist logic
This commit is contained in:
parent
98eb5e2cc0
commit
cd27cadb52
1 changed files with 19 additions and 8 deletions
|
@ -81,15 +81,26 @@ async def query_saucenao(url):
|
||||||
similarity = int(float(match['header']['similarity']))
|
similarity = int(float(match['header']['similarity']))
|
||||||
if similarity < 55:
|
if similarity < 55:
|
||||||
return False
|
return False
|
||||||
artist = 'member_name'
|
|
||||||
elif 'creator' in match['data']:
|
source = match['data']['ext_urls'][0]
|
||||||
artist = 'creator'
|
for e in match['data']['ext_urls']:
|
||||||
else:
|
if 'e621' in e:
|
||||||
artist = 'imdb_id'
|
source = e
|
||||||
|
break
|
||||||
|
|
||||||
|
artist = 'Unknown'
|
||||||
|
for e in (
|
||||||
|
'author_name',
|
||||||
|
'member_name',
|
||||||
|
'creator'
|
||||||
|
):
|
||||||
|
if e in match['data']:
|
||||||
|
artist = match['data'][e]
|
||||||
|
break
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
'source': match['data']['ext_urls'][0],
|
'source': source,
|
||||||
'artist': match['data'][artist],
|
'artist': artist,
|
||||||
'thumbnail': match['header']['thumbnail'],
|
'thumbnail': match['header']['thumbnail'],
|
||||||
'similarity': str(similarity),
|
'similarity': str(similarity),
|
||||||
'database': 'SauceNAO'
|
'database': 'SauceNAO'
|
||||||
|
|
Loading…
Reference in a new issue