[spankwire] fix check for description
authorPhilipp Hagemeister <phihag@phihag.de>
Wed, 20 Nov 2013 06:45:32 +0000 (07:45 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Wed, 20 Nov 2013 06:45:32 +0000 (07:45 +0100)
youtube_dl/extractor/spankwire.py

index 794550c81efc92fa8c033d8c5e36f4d416ab4855..995b464448211b72db20e3cf3c5d849d8521a4ab 100644 (file)
@@ -35,11 +35,12 @@ class SpankwireIE(InfoExtractor):
         webpage = self._download_webpage(req, video_id)
 
         video_title = self._html_search_regex(r'<h1>([^<]+)', webpage, u'title')
-        video_uploader = self._html_search_regex(r'by:\s*<a [^>]*>(.+?)</a>', webpage, u'uploader', fatal=False)
-        thumbnail = self._html_search_regex(r'flashvars\.image_url = "([^"]+)', webpage, u'thumbnail', fatal=False)
-        description = self._html_search_regex(r'>\s*Description:</div>\s*<[^>]*>([^<]+)', webpage, u'description', fatal=False)
-        if len(description) == 0:
-            description = None
+        video_uploader = self._html_search_regex(
+            r'by:\s*<a [^>]*>(.+?)</a>', webpage, u'uploader', fatal=False)
+        thumbnail = self._html_search_regex(
+            r'flashvars\.image_url = "([^"]+)', webpage, u'thumbnail', fatal=False)
+        description = self._html_search_regex(
+            r'>\s*Description:</div>\s*<[^>]+>([^<]+)', webpage, u'description', fatal=False)
 
         video_urls = list(map(compat_urllib_parse.unquote , re.findall(r'flashvars\.quality_[0-9]{3}p = "([^"]+)', webpage)))
         if webpage.find('flashvars\.encrypted = "true"') != -1: