fix url matching

This commit is contained in:
dave 2018-03-27 20:18:32 -07:00
parent ba85eee901
commit 02d1a8aa3e

View File

@ -76,7 +76,7 @@ class LinkTitler(ModuleBase):
# subreddits
# generic <title>
matches = re.compile(r'(https?://([a-zA-Z0-9_\-\.]+/([A-Za-z0-9\-\._~:\/?#[]@!$&\'\(\)\*\+\,\;=]+)?))') \
matches = re.compile(r'(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*))') \
.findall(trailing)
if matches:
done = []
@ -103,8 +103,6 @@ class LinkTitler(ModuleBase):
self.nicesize(int(headers["Content-Length"])) if
"Content-Length" in headers else "unknown size"))
return
def get_reddit_submission(self, subid):
r = praw.Reddit(**self.config["reddit"])
return r.submission(id=subid)