case insensitive <title> matching

This commit is contained in:
urlbot
2014-08-09 13:12:42 +02:00
parent 4bd04e767d
commit b904246c14

View File

@@ -58,7 +58,7 @@ def extract_title(url):
if 'text/' != headers['content-type'][:len('text/')]:
return (1, headers['content-type'])
result = re.match(r'.*?<title.*?>(.*?)</title>.*?', html, re.S|re.M)
result = re.match(r'.*?<title.*?>(.*?)</title>.*?', html, re.S|re.M|re.IGNORECASE)
if result:
return (0, result.groups()[0])
else: