[nova] Comply with review

This commit is contained in:
Slava Shklyaev 2015-06-02 18:15:05 +03:00
parent a00234f1c5
commit 4b5fe1349f
1 changed files with 10 additions and 8 deletions

View File

@ -4,7 +4,11 @@ from __future__ import unicode_literals
import re import re
from .common import InfoExtractor from .common import InfoExtractor
from ..utils import clean_html, determine_ext from ..utils import (
clean_html,
determine_ext,
unified_strdate,
)
class NovaIE(InfoExtractor): class NovaIE(InfoExtractor):
@ -143,14 +147,12 @@ class NovaIE(InfoExtractor):
description = clean_html(self._og_search_description(webpage, default=None)) description = clean_html(self._og_search_description(webpage, default=None))
thumbnail = config.get('poster') thumbnail = config.get('poster')
mobj = None
if site == 'novaplus': if site == 'novaplus':
mobj = re.search(r'(?P<day>\d{1,2})-(?P<month>\d{1,2})-(?P<year>\d{4})$', display_id) upload_date = unified_strdate(self._search_regex(
if site == 'fanda': r'(\d{1,2}-\d{1,2}-\d{4})$', display_id, 'upload date', default=None))
mobj = re.search( elif site == 'fanda':
r'<span class="date_time">(?P<day>\d{1,2})\.(?P<month>\d{1,2})\.(?P<year>\d{4})\b', webpage) upload_date = unified_strdate(self._search_regex(
if mobj: r'<span class="date_time">(\d{1,2}\.\d{1,2}\.\d{4})', webpage, 'upload date', default=None))
upload_date = '{}{:02d}{:02d}'.format(mobj.group('year'), int(mobj.group('month')), int(mobj.group('day')))
else: else:
upload_date = None upload_date = None