Improve some _VALID_URLs
[youtube-dl] / youtube_dl / extractor / openload.py
index e181d0b3aa1da1af48b0394aa349ca7bff51f109..c261a7455b37e0967aa1540dccce56c5db7cf30f 100644 (file)
@@ -13,7 +13,7 @@ from ..utils import (
 
 
 class OpenloadIE(InfoExtractor):
-    _VALID_URL = r'https://openload.(?:co|io)/(?:f|embed)/(?P<id>[a-zA-Z0-9-_]+)'
+    _VALID_URL = r'https?://openload\.(?:co|io)/(?:f|embed)/(?P<id>[a-zA-Z0-9-_]+)'
 
     _TESTS = [{
         'url': 'https://openload.co/f/kUEfGclsU9o',
@@ -55,10 +55,12 @@ class OpenloadIE(InfoExtractor):
 
         video_url_chars = []
 
-        for c in enc_data:
+        for idx, c in enumerate(enc_data):
             j = compat_ord(c)
             if j >= 33 and j <= 126:
                 j = ((j + 14) % 94) + 33
+            if idx == len(enc_data) - 1:
+                j += 3
             video_url_chars += compat_chr(j)
 
         video_url = 'https://openload.co/stream/%s?mime=true' % ''.join(video_url_chars)