diff options
author | Vijay Singh <sudovijay@users.noreply.github.com> | 2017-02-07 10:32:45 +0530 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2017-02-17 22:30:05 +0700 |
commit | d94badc755228ee3159b9b499aa718d27fa472ed (patch) | |
tree | 8b6f2d72e58d5d1c022e94e08b9c1599d459cf2b /youtube_dl | |
parent | fef51645d6c224f898ff6f44d041a458d21e8547 (diff) |
[openload] Semifix extraction (closes #10408)
just updated the code. i don't do much python still i tried to convert my code. lemme know if there is any prob with it
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/openload.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/youtube_dl/extractor/openload.py b/youtube_dl/extractor/openload.py index 32289d897..bd1120fd8 100644 --- a/youtube_dl/extractor/openload.py +++ b/youtube_dl/extractor/openload.py @@ -75,17 +75,20 @@ class OpenloadIE(InfoExtractor): '<span[^>]+id="[^"]+"[^>]*>([0-9]+)</span>', webpage, 'openload ID') - first_three_chars = int(float(ol_id[0:][:3])) - fifth_char = int(float(ol_id[3:5])) - urlcode = '' - num = 5 + first_two_chars = int(float(ol_id[0:][:2])) + urlcode = {} + num = 2 while num < len(ol_id): - urlcode += compat_chr(int(float(ol_id[num:][:3])) + - first_three_chars - fifth_char * int(float(ol_id[num + 3:][:2]))) + key = int(float(ol_id[num + 3:][:2])) + urlcode[key] = compat_chr(int(float(ol_id[num:][:3])) - first_two_chars) num += 5 + + sorted(urlcode, key=lambda key: urlcode[key]) - video_url = 'https://openload.co/stream/' + urlcode + urllink = ''.join(['%s' % (value) for (key, value) in urlcode.items()]) + + video_url = 'https://openload.co/stream/' + urllink title = self._og_search_title(webpage, default=None) or self._search_regex( r'<span[^>]+class=["\']title["\'][^>]*>([^<]+)', webpage, |