]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[openload] Fix extraction (closes #10408)
authorVijay Singh <sudovijay@users.noreply.github.com>
Sun, 8 Jan 2017 16:57:28 +0000 (22:27 +0530)
committerSergey M․ <dstftw@gmail.com>
Fri, 13 Jan 2017 16:40:19 +0000 (23:40 +0700)
Just a minor fix for openload

youtube_dl/extractor/openload.py

index 2ce9f38264f6dfb5e14bb8753afe6b3757872040..3d4ad7dca469a2da4430818ac3119de156f74420 100644 (file)
@@ -64,16 +64,17 @@ class OpenloadIE(InfoExtractor):
             raise ExtractorError('File not found', expected=True)
 
         ol_id = self._search_regex(
-            '<span[^>]+id="[a-zA-Z0-9]+x"[^>]*>([0-9]+)</span>',
+            '<span[^>]+id="[^"]+"[^>]*>([0-9]+)</span>',
             webpage, 'openload ID')
 
-        first_two_chars = int(float(ol_id[0:][:2]))
+        first_three_chars = int(float(ol_id[0:][:3]))
+        fifth_char = int(float(ol_id[3:5]))
         urlcode = ''
-        num = 2
+        num = 5
 
         while num < len(ol_id):
-            urlcode += compat_chr(int(float(ol_id[num:][:3])) -
-                                  first_two_chars * int(float(ol_id[num + 3:][:2])))
+            urlcode += compat_chr(int(float(ol_id[num:][:3])) +
+                                  first_three_chars - fifth_char * int(float(ol_id[num + 3:][:2])))
             num += 5
 
         video_url = 'https://openload.co/stream/' + urlcode