fix url matching
This commit is contained in:
parent
ba85eee901
commit
02d1a8aa3e
|
@ -76,7 +76,7 @@ class LinkTitler(ModuleBase):
|
||||||
# subreddits
|
# subreddits
|
||||||
|
|
||||||
# generic <title>
|
# 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)
|
.findall(trailing)
|
||||||
if matches:
|
if matches:
|
||||||
done = []
|
done = []
|
||||||
|
@ -103,8 +103,6 @@ class LinkTitler(ModuleBase):
|
||||||
self.nicesize(int(headers["Content-Length"])) if
|
self.nicesize(int(headers["Content-Length"])) if
|
||||||
"Content-Length" in headers else "unknown size"))
|
"Content-Length" in headers else "unknown size"))
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
def get_reddit_submission(self, subid):
|
def get_reddit_submission(self, subid):
|
||||||
r = praw.Reddit(**self.config["reddit"])
|
r = praw.Reddit(**self.config["reddit"])
|
||||||
return r.submission(id=subid)
|
return r.submission(id=subid)
|
||||||
|
|
Loading…
Reference in New Issue