duration is a time delta
This commit is contained in:
parent
118c26fe31
commit
b86e9d8a00
7 changed files with 16 additions and 18 deletions
|
|
@ -68,13 +68,13 @@ class VideoPage(PornPage):
|
|||
value = span.tail.strip()
|
||||
|
||||
if name == 'Duration:':
|
||||
duration = 0
|
||||
seconds = minutes = 0
|
||||
for word in value.split():
|
||||
if word.endswith('min'):
|
||||
duration += 60 * int(word[:word.find('min')])
|
||||
minutes = int(word[:word.find('min')])
|
||||
elif word.endswith('sec'):
|
||||
duration += int(word[:word.find('sec')])
|
||||
v.duration = duration
|
||||
seconds = int(word[:word.find('sec')])
|
||||
v.duration = datetime.timedelta(minutes=minutes, seconds=seconds)
|
||||
elif name == 'Submitted:':
|
||||
author = li.find('i')
|
||||
if author is None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue