[xhamster] Fix upload date extraction
authorSergey M․ <dstftw@gmail.com>
Fri, 8 Jan 2016 18:21:57 +0000 (00:21 +0600)
committerSergey M․ <dstftw@gmail.com>
Fri, 8 Jan 2016 18:21:57 +0000 (00:21 +0600)
youtube_dl/extractor/xhamster.py

index 97355d17fbfbacefa27a48940aae25d15770cea3..560c38e269c7f7eed8ed01f8ac2e66d032f68240 100644 (file)
@@ -72,10 +72,9 @@ class XHamsterIE(InfoExtractor):
         mobj = re.search(r'<span>Description: </span>([^<]+)', webpage)
         description = mobj.group(1) if mobj else None
 
-        upload_date = self._html_search_regex(r'hint=\'(\d{4}-\d{2}-\d{2}) \d{2}:\d{2}:\d{2} [A-Z]{3,4}\'',
-                                              webpage, 'upload date', fatal=False)
-        if upload_date:
-            upload_date = unified_strdate(upload_date)
+        upload_date = unified_strdate(self._search_regex(
+            r'hint=["\'](\d{4}-\d{2}-\d{2}) \d{2}:\d{2}:\d{2} [A-Z]{3,4}',
+            webpage, 'upload date', fatal=False))
 
         uploader = self._html_search_regex(
             r"<a href='[^']+xhamster\.com/user/[^>]+>(?P<uploader>[^<]+)",