[udemy] Initial support for free courses (#1617)
[youtube-dl] / youtube_dl / extractor / viki.py
index 7b3a58de8ed9bcd3162a5d62322f5ee757debef7..2206a06d59f57093f59135f6faa8d68381695a95 100644 (file)
@@ -2,6 +2,7 @@ import re
 
 from ..utils import (
     ExtractorError,
+    unescapeHTML,
     unified_strdate,
 )
 from .subtitles import SubtitlesInfoExtractor
@@ -34,11 +35,12 @@ class VikiIE(SubtitlesInfoExtractor):
         description = self._og_search_description(webpage)
         thumbnail = self._og_search_thumbnail(webpage)
 
-        uploader = self._html_search_regex(
-            r'<strong>Broadcast Network: </strong>\s*([^<]*)<', webpage,
-            u'uploader')
-        if uploader is not None:
-            uploader = uploader.strip()
+        uploader_m = re.search(
+            r'<strong>Broadcast Network: </strong>\s*([^<]*)<', webpage)
+        if uploader_m is None:
+            uploader = None
+        else:
+            uploader = uploader_m.group(1).strip()
 
         rating_str = self._html_search_regex(
             r'<strong>Rating: </strong>\s*([^<]*)<', webpage,
@@ -90,7 +92,8 @@ class VikiIE(SubtitlesInfoExtractor):
 
     def _get_available_subtitles(self, video_id, info_webpage):
         res = {}
-        for sturl in re.findall(r'<track src="([^"]+)"/>'):
+        for sturl_html in re.findall(r'<track src="([^"]+)"/>', info_webpage):
+            sturl = unescapeHTML(sturl_html)
             m = re.search(r'/(?P<lang>[a-z]+)\.vtt', sturl)
             if not m:
                 continue