aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/rtlnow.py
diff options
context:
space:
mode:
authorrzhxeo <rzhxeo@users.noreply.github.com>2013-10-01 07:22:49 +0200
committerrzhxeo <rzhxeo@users.noreply.github.com>2013-10-01 07:22:49 +0200
commitadfeafe9e19d3240bb07ad6ca97f01aed86c0615 (patch)
treeb84c714fe9037409073e7800280d02aae8fca881 /youtube_dl/extractor/rtlnow.py
parentc0de39e6d42d8de6a77768b2a96570fd8df8ad36 (diff)
[RTLnowIE] Allow video description without upload date
Some videos (feature films) have no upload date.
Diffstat (limited to 'youtube_dl/extractor/rtlnow.py')
-rw-r--r--youtube_dl/extractor/rtlnow.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/youtube_dl/extractor/rtlnow.py b/youtube_dl/extractor/rtlnow.py
index 32541077f..a156666f9 100644
--- a/youtube_dl/extractor/rtlnow.py
+++ b/youtube_dl/extractor/rtlnow.py
@@ -98,14 +98,17 @@ class RTLnowIE(InfoExtractor):
webpage, u'playerdata_url')
playerdata = self._download_webpage(playerdata_url, video_id)
- mobj = re.search(r'<title><!\[CDATA\[(?P<description>.+?)\s+- (?:Sendung )?vom (?P<upload_date_d>[0-9]{2})\.(?P<upload_date_m>[0-9]{2})\.(?:(?P<upload_date_Y>[0-9]{4})|(?P<upload_date_y>[0-9]{2})) [0-9]{2}:[0-9]{2} Uhr\]\]></title>', playerdata)
+ mobj = re.search(r'<title><!\[CDATA\[(?P<description>.+?)(?:\s+- (?:Sendung )?vom (?P<upload_date_d>[0-9]{2})\.(?P<upload_date_m>[0-9]{2})\.(?:(?P<upload_date_Y>[0-9]{4})|(?P<upload_date_y>[0-9]{2})) [0-9]{2}:[0-9]{2} Uhr)?\]\]></title>', playerdata)
if mobj:
video_description = mobj.group(u'description')
if mobj.group('upload_date_Y'):
video_upload_date = mobj.group('upload_date_Y')
- else:
+ elif mobj.group('upload_date_y'):
video_upload_date = u'20' + mobj.group('upload_date_y')
- video_upload_date += mobj.group('upload_date_m')+mobj.group('upload_date_d')
+ else:
+ video_upload_date = None
+ if video_upload_date:
+ video_upload_date += mobj.group('upload_date_m')+mobj.group('upload_date_d')
else:
video_description = None
video_upload_date = None