mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 21:02:38 +00:00
Merge branch 'dev'
This commit is contained in:
commit
dc866d1564
2 changed files with 7 additions and 5 deletions
|
@ -728,8 +728,10 @@ class MsG(cmds.Cog):
|
||||||
except exc.Continue:
|
except exc.Continue:
|
||||||
continue
|
continue
|
||||||
if post['id'] not in posts.keys() and post['id'] not in previous.keys():
|
if post['id'] not in posts.keys() and post['id'] not in previous.keys():
|
||||||
posts[post['id']] = {'artist': ', '.join(
|
posts[post['id']] = {
|
||||||
post['tags']['artist']), 'file_url': post['file']['url'], 'score': post['score']['total']}
|
'artist': ', '.join(post['tags']['artist']) if post['tags']['artist'] else 'unknown',
|
||||||
|
'file_url': post['file']['url'],
|
||||||
|
'score': post['score']['total']}
|
||||||
if len(posts) == limit:
|
if len(posts) == limit:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ async def query_kheina(url):
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
'source': content['results'][0]['sources'][0]['source'],
|
'source': content['results'][0]['sources'][0]['source'],
|
||||||
'artist': content['results'][0]['sources'][0]['artist'],
|
'artist': content['results'][0]['sources'][0]['artist'] if content['results'][0]['sources'][0]['artist'] else 'unknown',
|
||||||
'thumbnail': thumbnail,
|
'thumbnail': thumbnail,
|
||||||
'similarity': str(similarity),
|
'similarity': str(similarity),
|
||||||
'database': tld.extract(content['results'][0]['sources'][0]['source']).domain
|
'database': tld.extract(content['results'][0]['sources'][0]['source']).domain
|
||||||
|
@ -99,12 +99,12 @@ async def query_saucenao(url):
|
||||||
source = e
|
source = e
|
||||||
break
|
break
|
||||||
|
|
||||||
artist = 'Unknown'
|
artist = 'unknown'
|
||||||
for e in (
|
for e in (
|
||||||
'author_name',
|
'author_name',
|
||||||
'member_name',
|
'member_name',
|
||||||
'creator'):
|
'creator'):
|
||||||
if e in match['data']:
|
if e in match['data'] and match['data'][e]:
|
||||||
artist = match['data'][e]
|
artist = match['data'][e]
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue