mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 09:44:50 +00:00
Fix NunaDrama Search
Signed-off-by: Yasir Aris <git@yasir.id>
This commit is contained in:
parent
212029c667
commit
d36a3156d3
1 changed files with 4 additions and 4 deletions
|
|
@ -392,17 +392,17 @@ async def getDataNunaDrama(msg, kueri, CurrentPage, user, strings):
|
||||||
if not SCRAP_DICT.get(msg.id):
|
if not SCRAP_DICT.get(msg.id):
|
||||||
with contextlib.redirect_stdout(sys.stderr):
|
with contextlib.redirect_stdout(sys.stderr):
|
||||||
try:
|
try:
|
||||||
gomovv = await fetch.get(
|
nunafetch = await fetch.get(
|
||||||
f"{web['nunadrama']}/?s={kueri}", follow_redirects=True
|
f"{web['nunadrama']}/?s={kueri}", follow_redirects=True
|
||||||
)
|
)
|
||||||
gomovv.raise_for_status()
|
nunafetch.raise_for_status()
|
||||||
except httpx.HTTPError as exc:
|
except httpx.HTTPError as exc:
|
||||||
await msg.edit_msg(
|
await msg.edit_msg(
|
||||||
f"ERROR: Failed to fetch data from {exc.request.url} - <code>{exc}</code>",
|
f"ERROR: Failed to fetch data from {exc.request.url} - <code>{exc}</code>",
|
||||||
disable_web_page_preview=True,
|
disable_web_page_preview=True,
|
||||||
)
|
)
|
||||||
return None, 0, None
|
return None, 0, None
|
||||||
text = BeautifulSoup(gomovv, "lxml")
|
text = BeautifulSoup(nunafetch, "lxml")
|
||||||
entry = text.find_all(class_="entry-header")
|
entry = text.find_all(class_="entry-header")
|
||||||
if entry[0].text.strip() == "Nothing Found":
|
if entry[0].text.strip() == "Nothing Found":
|
||||||
if not kueri:
|
if not kueri:
|
||||||
|
|
@ -425,7 +425,7 @@ async def getDataNunaDrama(msg, kueri, CurrentPage, user, strings):
|
||||||
PageLen = len(SCRAP_DICT[msg.id][0])
|
PageLen = len(SCRAP_DICT[msg.id][0])
|
||||||
extractbtn = []
|
extractbtn = []
|
||||||
|
|
||||||
gomovResult = (
|
nunaResult = (
|
||||||
strings("header_with_query").format(web="NunaDrama", kueri=kueri)
|
strings("header_with_query").format(web="NunaDrama", kueri=kueri)
|
||||||
if kueri
|
if kueri
|
||||||
else strings("header_no_query").format(web="NunaDrama", cmd="nunadrama")
|
else strings("header_no_query").format(web="NunaDrama", cmd="nunadrama")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue