X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=youtube_dl%2Fextractor%2Fopenload.py;h=d3d4101de8a84edda5ec641d299ed7e3813a2910;hb=b2fc1c4fb965c08067cf42e5a7aaab45df8c2d5f;hp=b6e3ac25037656547974011d1dfffbf67694ad9d;hpb=4ddcb5999d0323fb83c5b879127d31763f5d63e2;p=youtube-dl
diff --git a/youtube_dl/extractor/openload.py b/youtube_dl/extractor/openload.py
index b6e3ac250..d3d4101de 100644
--- a/youtube_dl/extractor/openload.py
+++ b/youtube_dl/extractor/openload.py
@@ -24,6 +24,22 @@ class OpenloadIE(InfoExtractor):
'title': 'skyrim_no-audio_1080.mp4',
'thumbnail': 're:^https?://.*\.jpg$',
},
+ }, {
+ 'url': 'https://openload.co/embed/rjC09fkPLYs',
+ 'info_dict': {
+ 'id': 'rjC09fkPLYs',
+ 'ext': 'mp4',
+ 'title': 'movie.mp4',
+ 'thumbnail': 're:^https?://.*\.jpg$',
+ 'subtitles': {
+ 'en': [{
+ 'ext': 'vtt',
+ }],
+ },
+ },
+ 'params': {
+ 'skip_download': True, # test subtitles only
+ },
}, {
'url': 'https://openload.co/embed/kUEfGclsU9o/skyrim_no-audio_1080.mp4',
'only_matching': True,
@@ -54,14 +70,19 @@ class OpenloadIE(InfoExtractor):
r']*>([^<]+)\s*]*>[^<]+\s*]+id="streamurl"',
webpage, 'encrypted data')
+ magic = compat_ord(enc_data[-1])
video_url_chars = []
for idx, c in enumerate(enc_data):
j = compat_ord(c)
+ if j == magic:
+ j -= 1
+ elif j == magic - 1:
+ j += 1
if j >= 33 and j <= 126:
j = ((j + 14) % 94) + 33
if idx == len(enc_data) - 1:
- j += 2
+ j += 3
video_url_chars += compat_chr(j)
video_url = 'https://openload.co/stream/%s?mime=true' % ''.join(video_url_chars)
@@ -71,11 +92,17 @@ class OpenloadIE(InfoExtractor):
'title', default=None) or self._html_search_meta(
'description', webpage, 'title', fatal=True)
- return {
+ entries = self._parse_html5_media_entries(url, webpage, video_id)
+ subtitles = entries[0]['subtitles'] if entries else None
+
+ info_dict = {
'id': video_id,
'title': title,
'thumbnail': self._og_search_thumbnail(webpage, default=None),
'url': video_url,
# Seems all videos have extensions in their titles
'ext': determine_ext(title),
+ 'subtitles': subtitles,
}
+
+ return info_dict