mirror of
https://github.com/myned/modufur.git
synced 2025-02-22 19:46:24 +00:00
Change semantics to clarify action
This commit is contained in:
parent
5987b46925
commit
e51c5615d8
1 changed files with 4 additions and 4 deletions
|
@ -40,7 +40,7 @@ from utils import utils as u
|
||||||
# return False
|
# return False
|
||||||
|
|
||||||
|
|
||||||
async def get_kheina(url):
|
async def query_kheina(url):
|
||||||
content = await u.fetch('https://kheina.com', params={'url': url}, text=True)
|
content = await u.fetch('https://kheina.com', params={'url': url}, text=True)
|
||||||
|
|
||||||
content = content.replace('"', 'quot;').replace(''', 'apos;')
|
content = content.replace('"', 'quot;').replace(''', 'apos;')
|
||||||
|
@ -66,7 +66,7 @@ async def get_kheina(url):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
async def get_saucenao(url):
|
async def query_saucenao(url):
|
||||||
content = await u.fetch(
|
content = await u.fetch(
|
||||||
'https://saucenao.com/search.php',
|
'https://saucenao.com/search.php',
|
||||||
params={'url': url, 'api_key': u.config['saucenao_api'], 'output_type': 2},
|
params={'url': url, 'api_key': u.config['saucenao_api'], 'output_type': 2},
|
||||||
|
@ -102,9 +102,9 @@ 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 get_kheina(url)
|
result = await query_kheina(url)
|
||||||
if int(result['similarity']) < 55:
|
if int(result['similarity']) < 55:
|
||||||
result = await get_saucenao(url)
|
result = await query_saucenao(url)
|
||||||
if int(result['similarity']) < 55:
|
if int(result['similarity']) < 55:
|
||||||
raise exc.MatchError(re.search('\\/([^\\/]+)$', url).group(1))
|
raise exc.MatchError(re.search('\\/([^\\/]+)$', url).group(1))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue