diff --git a/ox/web/imdb.py b/ox/web/imdb.py index 993cc9c..c4b51b1 100644 --- a/ox/web/imdb.py +++ b/ox/web/imdb.py @@ -476,9 +476,8 @@ class Imdb(SiteParser): alt[title].append(c) self['alternativeTitles'] = [] for t in sorted(alt, key=lambda a: sorted(alt[a])): - if alt[t]: - countries = sorted([normalize_country_name(c) or c for c in alt[t]]) - self['alternativeTitles'].append((t, countries)) + countries = sorted([normalize_country_name(c) or c for c in alt[t]]) + self['alternativeTitles'].append((t, countries)) if not self['alternativeTitles']: del self['alternativeTitles'] diff --git a/ox/web/ubu.py b/ox/web/ubu.py index aab3dd4..ba05751 100644 --- a/ox/web/ubu.py +++ b/ox/web/ubu.py @@ -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(".*?&(.*?)").findall(data) + match = re.compile(".*?&(.*?)", 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: