mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Properly limit window size
This commit is contained in:
parent
c6ff99452e
commit
72ab2ada1f
1 changed files with 3 additions and 2 deletions
|
@ -735,7 +735,8 @@ class OtherCog(commands.Cog):
|
||||||
):
|
):
|
||||||
"""Takes a screenshot of a URL"""
|
"""Takes a screenshot of a URL"""
|
||||||
if capture_whole_page and browser != "firefox":
|
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_width = max(min(15360 * 6, window_width), 256)
|
||||||
window_height = max(min(8640 * 6, window_height), 144)
|
window_height = max(min(8640 * 6, window_height), 144)
|
||||||
await ctx.defer()
|
await ctx.defer()
|
||||||
|
@ -765,7 +766,7 @@ class OtherCog(commands.Cog):
|
||||||
try:
|
try:
|
||||||
# noinspection PyTypeChecker
|
# noinspection PyTypeChecker
|
||||||
for response in await asyncio.to_thread(dns.resolver.resolve, url.hostname, "A"):
|
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"
|
return "DNS blacklist"
|
||||||
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.resolver.LifetimeTimeout, AttributeError):
|
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.resolver.LifetimeTimeout, AttributeError):
|
||||||
return "Invalid domain or DNS error"
|
return "Invalid domain or DNS error"
|
||||||
|
|
Loading…
Reference in a new issue