Properly limit window size

This commit is contained in:
Nexus 2023-11-29 15:19:41 +00:00
parent c6ff99452e
commit 72ab2ada1f
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -735,7 +735,8 @@ class OtherCog(commands.Cog):
):
"""Takes a screenshot of a URL"""
if capture_whole_page and browser != "firefox":
return await ctx.respond("The capture-full-page option is only available for firefox.")
await ctx.respond(":warning: capture-full-page is only available with firefox; switching browser.")
browser = "firefox"
window_width = max(min(15360 * 6, window_width), 256)
window_height = max(min(8640 * 6, window_height), 144)
await ctx.defer()
@ -765,7 +766,7 @@ class OtherCog(commands.Cog):
try:
# noinspection PyTypeChecker
for response in await asyncio.to_thread(dns.resolver.resolve, url.hostname, "A"):
if response.address == "0.0.0.0":
if response.address in ["0.0.0.0", "::", "127.0.0.1", "::1"]:
return "DNS blacklist"
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.resolver.LifetimeTimeout, AttributeError):
return "Invalid domain or DNS error"