1
0
Fork 0
mirror of https://gitlab.com/dstftw/youtube-dl.git synced 2020-11-16 09:42:26 +00:00

[openload] fix extraction(closes #10408)

This commit is contained in:
Remita Amine 2017-02-24 11:21:13 +01:00
parent 42dcdbe11c
commit 39e7277ed1

View file

@ -72,16 +72,21 @@ class OpenloadIE(InfoExtractor):
raise ExtractorError('File not found', expected=True) raise ExtractorError('File not found', expected=True)
ol_id = self._search_regex( ol_id = self._search_regex(
'<span[^>]+id="[^"]+"[^>]*>([0-9]+)</span>', '<span[^>]+id="[^"]+"[^>]*>([0-9A-Za-z]+)</span>',
webpage, 'openload ID') webpage, 'openload ID')
first_two_chars = int(float(ol_id[0:][:2])) first_char = int(ol_id[0])
urlcode = [] urlcode = []
num = 2 num = 1
while num < len(ol_id): while num < len(ol_id):
key = int(float(ol_id[num + 3:][:2])) i = ord(ol_id[num])
urlcode.append((key, compat_chr(int(float(ol_id[num:][:3])) - first_two_chars))) key = 0
if i <= 90:
key = i - 65
elif i >= 97:
key = 25 + i - 97
urlcode.append((key, compat_chr(int(ol_id[num + 2:num + 5]) // int(ol_id[num + 1]) - first_char)))
num += 5 num += 5
video_url = 'https://openload.co/stream/' + ''.join( video_url = 'https://openload.co/stream/' + ''.join(