]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[viki] Fix subtitle extraction
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 25 Nov 2013 05:06:18 +0000 (06:06 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 25 Nov 2013 05:06:18 +0000 (06:06 +0100)
youtube_dl/extractor/viki.py
youtube_dl/utils.py

index ac199d4109fd30f55e0db7283a1c51e96261abf4..2206a06d59f57093f59135f6faa8d68381695a95 100644 (file)
@@ -2,6 +2,7 @@ import re
 
 from ..utils import (
     ExtractorError,
+    unescapeHTML,
     unified_strdate,
 )
 from .subtitles import SubtitlesInfoExtractor
@@ -91,7 +92,8 @@ class VikiIE(SubtitlesInfoExtractor):
 
     def _get_available_subtitles(self, video_id, info_webpage):
         res = {}
-        for sturl in re.findall(r'<track src="([^"]+)"/>', info_webpage):
+        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
index caec00e373898bd8a955e96ea8dfdbbb0831d7aa..946e90e93061bb7ff26b46595dfd7930974323b9 100644 (file)
@@ -553,7 +553,7 @@ def make_HTTPS_handler(opts_no_check_certificate):
                     self._tunnel()
                 try:
                     self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file, ssl_version=ssl.PROTOCOL_SSLv3)
-                except ssl.SSLError as e:
+                except ssl.SSLError:
                     self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file, ssl_version=ssl.PROTOCOL_SSLv23)
 
         class HTTPSHandlerV3(compat_urllib_request.HTTPSHandler):