]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/openload.py
2 from __future__
import unicode_literals
, division
4 from .common
import InfoExtractor
15 class OpenloadIE(InfoExtractor
):
16 _VALID_URL
= r
'https?://openload\.(?:co|io)/(?:f|embed)/(?P<id>[a-zA-Z0-9-_]+)'
19 'url': 'https://openload.co/f/kUEfGclsU9o',
20 'md5': 'bf1c059b004ebc7a256f89408e65c36e',
24 'title': 'skyrim_no-audio_1080.mp4',
25 'thumbnail': 're:^https?://.*\.jpg$',
28 'url': 'https://openload.co/embed/kUEfGclsU9o/skyrim_no-audio_1080.mp4',
29 'only_matching': True,
31 'url': 'https://openload.io/f/ZAn6oz-VZGE/',
32 'only_matching': True,
34 'url': 'https://openload.co/f/_-ztPaZtMhM/',
35 'only_matching': True,
37 # unavailable via https://openload.co/f/Sxz5sADo82g/, different layout
39 'url': 'https://openload.co/embed/Sxz5sADo82g/',
40 'only_matching': True,
43 def _real_extract(self
, url
):
44 video_id
= self
._match
_id
(url
)
45 webpage
= self
._download
_webpage
('https://openload.co/embed/%s/' % video_id
, video_id
)
47 if 'File not found' in webpage
or 'deleted by the owner' in webpage
:
48 raise ExtractorError('File not found', expected
=True)
50 # The following decryption algorithm is written by @yokrysty and
51 # declared to be freely used in youtube-dl
52 # See https://github.com/rg3/youtube-dl/issues/10408
53 enc_data
= self
._html
_search
_regex
(
54 r
'<span[^>]*>([^<]+)</span>\s*<span[^>]*>[^<]+</span>\s*<span[^>]+id="streamurl"',
55 webpage
, 'encrypted data')
59 for idx
, c
in enumerate(enc_data
):
61 if j
>= 33 and j
<= 126:
62 j
= ((j
+ 14) % 94) + 33
63 if idx
== len(enc_data
) - 1:
65 video_url_chars
+= compat_chr(j
)
67 video_url
= 'https://openload.co/stream/%s?mime=true' % ''.join(video_url_chars
)
69 title
= self
._og
_search
_title
(webpage
, default
=None) or self
._search
_regex
(
70 r
'<span[^>]+class=["\']title
["\'][^>]*>([^<]+)', webpage,
71 'title', default=None) or self._html_search_meta(
72 'description', webpage, 'title', fatal=True)
77 'thumbnail': self._og_search_thumbnail(webpage, default=None),
79 # Seems all videos have extensions in their titles
80 'ext': determine_ext(title),