diff --git a/modules/url.py b/modules/url.py index 11bbccc..6bafb12 100755 --- a/modules/url.py +++ b/modules/url.py @@ -10,7 +10,7 @@ import requests from module import hook, url_callback -HEADERS = {"User-Agent": "Give me your data.", "Range": "bytes=0-4096"} +HEADERS = {"User-Agent": "Give me your data.", "Range": "bytes=0-8192"} @url_callback('puu.sh/') def get_puush_fname(bot, url): @@ -82,9 +82,11 @@ def title_auto(bot, trigger): continue if not res.headers.get("Content-Type").startswith("text/html"): continue - if res.text.find("") == -1: + if res.text.find("<title") == -1: continue - title = res.text[res.text.find("<title>")+7:res.text.find("")] + data = res.text[res.text.find("", "", data) + title = data[:data.find("")] title = html.unescape(title) title = title.replace("\n","").strip() hostname = urlparse(url).hostname