Browse Source

[viki] Fix subtitle extraction

rtmp_test
Philipp Hagemeister 11 years ago
parent
commit
de79c46c8f
2 changed files with 4 additions and 2 deletions
  1. +3
    -1
      youtube_dl/extractor/viki.py
  2. +1
    -1
      youtube_dl/utils.py

+ 3
- 1
youtube_dl/extractor/viki.py View File

@ -2,6 +2,7 @@ import re
from ..utils import ( from ..utils import (
ExtractorError, ExtractorError,
unescapeHTML,
unified_strdate, unified_strdate,
) )
from .subtitles import SubtitlesInfoExtractor from .subtitles import SubtitlesInfoExtractor
@ -91,7 +92,8 @@ class VikiIE(SubtitlesInfoExtractor):
def _get_available_subtitles(self, video_id, info_webpage): def _get_available_subtitles(self, video_id, info_webpage):
res = {} 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) m = re.search(r'/(?P<lang>[a-z]+)\.vtt', sturl)
if not m: if not m:
continue continue


+ 1
- 1
youtube_dl/utils.py View File

@ -553,7 +553,7 @@ def make_HTTPS_handler(opts_no_check_certificate):
self._tunnel() self._tunnel()
try: try:
self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file, ssl_version=ssl.PROTOCOL_SSLv3) 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) self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file, ssl_version=ssl.PROTOCOL_SSLv23)
class HTTPSHandlerV3(compat_urllib_request.HTTPSHandler): class HTTPSHandlerV3(compat_urllib_request.HTTPSHandler):


Loading…
Cancel
Save