new API for the fillobj feature and severaaal fixes

This commit is contained in:
Romain Bignon 2010-07-18 00:35:07 +02:00
commit edc83df3a1
11 changed files with 60 additions and 42 deletions

View file

@ -43,7 +43,14 @@ class IndexPage(BasePage):
title = title_el.text.strip()
time_span = select(span, 'span.thumbtime span', 1)
minutes, seconds = (int(v) for v in time_span.text.strip().split(':'))
time_txt = time_span.text.strip()
if time_txt == 'N/A':
minutes, seconds = 0, 0
elif ':' in time_txt:
minutes, seconds = (int(v) for v in time_txt.split(':'))
else:
raise SelectElementException('Unable to parse the video duration: %s' % time_txt)
yield YoujizzVideo(_id,
title=title,