disable urlinfo as it can make the bot run OOM

This commit is contained in:
jkhsjdhjs 2023-07-16 22:24:49 +00:00
parent 7009169145
commit e6f8dbd1e8

24
bert.py
View File

@ -502,18 +502,18 @@ def command_loop():
say(channel, b+user+": "+c+text) say(channel, b+user+": "+c+text)
except Exception as err: except Exception as err:
print("twitter link invalid "+str(err)) print("twitter link invalid "+str(err))
elif urlinfo.is_url(msg) != None: # elif urlinfo.is_url(msg) != None:
try: # try:
url = urlinfo.is_url(msg) # url = urlinfo.is_url(msg)
ignore = ["pr0gramm", "w0bm", "f0ck", "twitter", "youtube", "youtu.be"] # ignore = ["pr0gramm", "w0bm", "f0ck", "twitter", "youtube", "youtu.be"]
if any(ign in url for ign in ignore): # if any(ign in url for ign in ignore):
pass # pass
else: # else:
title = urlinfo.get_title(url) # title = urlinfo.get_title(url)
print("Found URL and got title "+str(title)) # print("Found URL and got title "+str(title))
say(channel, b+"Title: "+c+title) # say(channel, b+"Title: "+c+title)
except Exception as err: # except Exception as err:
print("Error getting URL title - "+str(err)) # print("Error getting URL title - "+str(err))
elif msg == ".fml": elif msg == ".fml":
try: try:
fml_string = fml.get_fml(fml_url) fml_string = fml.get_fml(fml_url)