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
44d98cec0d
1 changed files with 75 additions and 68 deletions
|
@ -41,6 +41,7 @@ from utils import utils as u
|
||||||
|
|
||||||
|
|
||||||
async def query_kheina(url):
|
async def query_kheina(url):
|
||||||
|
try:
|
||||||
content = await u.fetch('https://kheina.com', params={'url': url}, text=True)
|
content = await u.fetch('https://kheina.com', params={'url': url}, text=True)
|
||||||
|
|
||||||
for e in ('"', '''):
|
for e in ('"', '''):
|
||||||
|
@ -76,8 +77,12 @@ async def query_kheina(url):
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
except Exception:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
async def query_saucenao(url):
|
async def query_saucenao(url):
|
||||||
|
try:
|
||||||
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},
|
||||||
|
@ -105,8 +110,7 @@ async def query_saucenao(url):
|
||||||
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']:
|
||||||
artist = match['data'][e]
|
artist = match['data'][e]
|
||||||
break
|
break
|
||||||
|
@ -121,6 +125,9 @@ async def query_saucenao(url):
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
except Exception:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
async def get_post(url):
|
async def get_post(url):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue