From 166fb01bc51ec531081646c85851fcd982e488c9 Mon Sep 17 00:00:00 2001 From: Swee Date: Sat, 12 Oct 2024 15:53:35 -0700 Subject: [PATCH] Update sweebot.py --- sweebot.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sweebot.py b/sweebot.py index c2ebe54..df52fe5 100644 --- a/sweebot.py +++ b/sweebot.py @@ -13,8 +13,7 @@ from pathlib import Path from requests import get from bs4 import BeautifulSoup headers = { - 'User-Agent': 'SweeBot IRC ' + __version__, - 'From': 'bot@swee.codes' + 'User-Agent': 'SweeBot IRC ' + __version__ } class config: def __init__(self): @@ -577,14 +576,14 @@ while True: try: for i in command: if i[:8] == "https://": - e = get(i, headers=headers) + e = get(i, headers=headers, timeout=10) if e.ok: soup = BeautifulSoup(e.text, 'html.parser') multiline("(" + nick + ") " + soup.title.string if soup.title.string != None else "[No title provided]", channel) else: multiline("(" + nick + ") [HTTP " + str(e.status_code) + "]", channel) elif i[:7] == "http://": - e = get(i, headers=headers) + e = get(i, headers=headers, timeout=10) if e.ok: soup = BeautifulSoup(e.text, 'html.parser') multiline("(" + nick + ") " + soup.title.string if soup.title.string != None else "[No title provided]", channel)