better title

This commit is contained in:
j 2015-03-15 02:38:38 +05:30
parent 36c1754725
commit ed465c527f

View file

@ -39,6 +39,12 @@ def get_data(url):
if 'title' in m:
m['title'] = re.sub('(.*?) \(\d{4}\)$', '\\1', m['title'])
if not 'title' in m:
match = re.compile("<title>.*?&amp;(.*?)</title>").findall(data)
if match:
m['title'] = match[0].strip()
if ' - ' in m['title']:
m['title'] = m['title'].split(' - ', 1)[-1]
match = re.compile("flashvars','file=(.*?.flv)'").findall(data)
if match:
m['flv'] = match[0]