bugfix
This commit is contained in:
parent
3c55b0e9d1
commit
421c8883f6
|
@ -49,5 +49,5 @@ def gettld(bot, trigger):
|
||||||
for n in range(len(table_headers)):
|
for n in range(len(table_headers)):
|
||||||
msg += f"\x0310{table_headers[n]}\x03: "
|
msg += f"\x0310{table_headers[n]}\x03: "
|
||||||
msg += f"\x0312{table_entries[n]}\x03 | "
|
msg += f"\x0312{table_entries[n]}\x03 | "
|
||||||
msg = msg[:-3]
|
msg = msg[:-3].replace("\n","")
|
||||||
bot.msg(msg)
|
bot.msg(msg)
|
||||||
|
|
|
@ -37,7 +37,7 @@ def title_auto(bot, trigger):
|
||||||
try:
|
try:
|
||||||
res = requests.get(url, headers=HEADERS, verify=True, timeout=10)
|
res = requests.get(url, headers=HEADERS, verify=True, timeout=10)
|
||||||
except (requests.exceptions.ConnectionError,
|
except (requests.exceptions.ConnectionError,
|
||||||
requests.execeptions.ReadTimeout):
|
requests.exceptions.ReadTimeout):
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
res.raise_for_status()
|
res.raise_for_status()
|
||||||
|
@ -52,6 +52,6 @@ def title_auto(bot, trigger):
|
||||||
title = res.text[res.text.find("<title>")+7:res.text.find("</title>")]
|
title = res.text[res.text.find("<title>")+7:res.text.find("</title>")]
|
||||||
title = HTMLParser().unescape(title)
|
title = HTMLParser().unescape(title)
|
||||||
title = title.replace("\n","").strip()
|
title = title.replace("\n","").strip()
|
||||||
title = title.encode("latin-1").decode("utf-8")
|
#title = title.encode("windows_1252").decode("utf-8")
|
||||||
hostname = urlparse(url).hostname
|
hostname = urlparse(url).hostname
|
||||||
bot.msg(f"[ \x0310{title} \x03] - \x0304{hostname}")
|
bot.msg(f"[ \x0310{title} \x03] - \x0304{hostname}")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user