[tnaflixnetworkbase] Improve title extraction
authorSergey M․ <dstftw@gmail.com>
Sun, 7 Aug 2016 08:59:05 +0000 (15:59 +0700)
committerSergey M․ <dstftw@gmail.com>
Sun, 7 Aug 2016 09:00:09 +0000 (16:00 +0700)
youtube_dl/extractor/tnaflix.py

index 74a0c8f172761290abe54a83b281e770dfc6d926..7ddf77767d804faff4097d85d796760bc4473b77 100644 (file)
@@ -118,8 +118,12 @@ class TNAFlixNetworkBaseIE(InfoExtractor):
             xpath_text(cfg_xml, './startThumb', 'thumbnail'), 'http:')
         thumbnails = self._extract_thumbnails(cfg_xml)
 
-        title = self._html_search_regex(
-            self._TITLE_REGEX, webpage, 'title') if self._TITLE_REGEX else self._og_search_title(webpage)
+        title = None
+        if self._TITLE_REGEX:
+            title = self._html_search_regex(
+                self._TITLE_REGEX, webpage, 'title', default=None)
+        if not title:
+            title = self._og_search_title(webpage)
 
         age_limit = self._rta_search(webpage) or 18