From a3e6887fc92ff94d212d3256c87e4d61a2a5d5de Mon Sep 17 00:00:00 2001 From: Gordon Shumway Date: Sat, 27 Jun 2020 14:23:08 -0400 Subject: [PATCH] Keep closing parenthesis when snarfing URLs Fixes bug when handling URLs with a closing parenthesis ')'. e.g. https://en.wikipedia.org/wiki/Harley_Quinn_(TV_series) --- src/utils/web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/web.py b/src/utils/web.py index 923a25a43..ae85faf7f 100644 --- a/src/utils/web.py +++ b/src/utils/web.py @@ -87,7 +87,7 @@ _domain = r'%s(?:\.%s)*\.[0-9a-z][-0-9a-z]+' % (_label, _label) _urlRe = r'(%s://(?:\S+@)?(?:%s|%s)(?::\d+)?(?:/[^\])>\s]*)?)' % ( _scheme, _domain, _ipAddr) urlRe = re.compile(_urlRe, re.I) -_httpUrlRe = r'(https?://(?:\S+@)?(?:%s|%s)(?::\d+)?(?:/[^\])>\s]*)?)' % \ +_httpUrlRe = r'(https?://(?:\S+@)?(?:%s|%s)(?::\d+)?(?:/[^\]>\s]*)?)' % \ (_domain, _ipAddr) httpUrlRe = re.compile(_httpUrlRe, re.I)