1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-12-24 22:27:28 +00:00

Change reverse image preference to SauceNAO and improve filtering

This commit is contained in:
Myned 2019-11-12 15:28:11 -05:00
parent b521bba22a
commit 68fc9bb541
No known key found for this signature in database
GPG key ID: BC58C09870A63E59

View file

@ -140,9 +140,16 @@ async def get_post(url):
if filesize > 8192 * 1024: if filesize > 8192 * 1024:
raise exc.SizeError(size(filesize, system=alternative)) raise exc.SizeError(size(filesize, system=alternative))
result = await query_kheina(url) # Prioritize SauceNAO if e621/furaffinity, Kheina>SauceNAO if not
if not result: result = await query_saucenao(url)
result = await query_saucenao(url) if result:
if not any(s in result['source'] for s in ('e621', 'furaffinity')):
kheina = await query_kheina(url)
if kheina:
result = kheina
else:
result = await query_kheina(url)
if not result: if not result:
raise exc.MatchError(re.search('\\/([^\\/]+)$', url).group(1)) raise exc.MatchError(re.search('\\/([^\\/]+)$', url).group(1))