mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 13:02:38 +00:00
Change reverse image preference to SauceNAO and improve filtering
This commit is contained in:
parent
b521bba22a
commit
68fc9bb541
1 changed files with 10 additions and 3 deletions
|
@ -140,9 +140,16 @@ async def get_post(url):
|
|||
if filesize > 8192 * 1024:
|
||||
raise exc.SizeError(size(filesize, system=alternative))
|
||||
|
||||
result = await query_kheina(url)
|
||||
if not result:
|
||||
result = await query_saucenao(url)
|
||||
# Prioritize SauceNAO if e621/furaffinity, Kheina>SauceNAO if not
|
||||
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:
|
||||
raise exc.MatchError(re.search('\\/([^\\/]+)$', url).group(1))
|
||||
|
||||
|
|
Loading…
Reference in a new issue