Fix screenshot DNS resolver

This commit is contained in:
nex 2023-01-16 10:57:42 +00:00
parent 0fd2713d5f
commit d444f7b303

View file

@ -435,7 +435,12 @@ class OtherCog(commands.Cog):
return await ctx.respond("No.")
url = urlparse(url)
if not url.scheme:
url = url._replace(scheme="http")
if "/" in url.path:
hostname, path = url.path.split("/", 1)
else:
hostname = url.path
path = ""
url = url._replace(scheme="http", hostname=hostname, path=path)
friendly_url = textwrap.shorten(url.geturl(), 100)