titles without countries

This commit is contained in:
j 2015-05-04 10:53:17 +02:00
commit 5bf53ba463
2 changed files with 4 additions and 5 deletions

View file

@ -44,9 +44,9 @@ def get_data(url):
if match:
m['title'] = strip_tags(decode_html(match[0])).strip()
if not 'title' in m:
match = re.compile("<title>.*?&amp;(.*?)</title>").findall(data)
match = re.compile("<title>.*?&amp;(.*?)</title>", re.DOTALL).findall(data)
if match:
m['title'] = match[0].strip()
m['title'] = re.sub('\s+', ' ', match[0]).strip()
if ' - ' in m['title']:
m['title'] = m['title'].split(' - ', 1)[-1]
if 'title' in m: