Skip to content

Commit

Permalink
Update inline.py
Browse files Browse the repository at this point in the history
  • Loading branch information
OasisAkari committed Jan 17, 2025
1 parent 94c0559 commit 86330f5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modules/wiki/inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ async def bgtask():
get_page = None
if isint(get_id):
get_page = await wiki_.parse_page_info(pageid=int(get_id))
if not q[qq].in_allowlist:
if not q[qq].in_allowlist and Info.use_url_manager:
for result in await check(get_page.title):
if not result["status"]:
return
elif get_title != "":
title = urllib.parse.unquote(get_title)
if not q[qq].in_allowlist:
if not q[qq].in_allowlist and Info.use_url_manager:
for result in await check(title):
if not result["status"]:
return
Expand Down Expand Up @@ -178,7 +178,7 @@ async def bgtask():
if (
get_page.status
and get_page.title
and wiki_.wiki_info.in_allowlist
and (wiki_.wiki_info.in_allowlist or not Info.use_url_manager)
):
if (
wiki_.wiki_info.realurl
Expand All @@ -200,7 +200,7 @@ async def bgtask():
)
get_infobox = await generate_screenshot_v2(
qq,
allow_special_page=q[qq].in_allowlist,
allow_special_page=(q[qq].in_allowlist or not Info.use_url_manager),
content_mode=content_mode,
)
if get_infobox:
Expand All @@ -220,7 +220,7 @@ async def bgtask():
if (
(
get_page.invalid_section
and wiki_.wiki_info.in_allowlist
and (wiki_.wiki_info.in_allowlist or not Info.use_url_manager)
)
or (
get_page.is_talk_page
Expand All @@ -239,7 +239,7 @@ async def bgtask():
"wiki.message.invalid_section.prompt"
if (
get_page.invalid_section
and wiki_.wiki_info.in_allowlist
and (wiki_.wiki_info.in_allowlist or not Info.use_url_manager)
)
else "wiki.message.talk_page.prompt"
)
Expand Down Expand Up @@ -346,7 +346,7 @@ async def _callback(msg: Bot.MessageSession):
section_.append(qs)
if section_:
s = urllib.parse.unquote("".join(section_)[1:])
if q[qq].realurl and q[qq].in_allowlist:
if q[qq].realurl and (q[qq].in_allowlist or not Info.use_url_manager):
if q[qq].realurl in generate_screenshot_v2_blocklist:
get_section = await generate_screenshot_v1(
q[qq].realurl, qq, headers, section=s
Expand Down

0 comments on commit 86330f5

Please sign in to comment.