1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-13 20:37:15 +08:00

[openload] fixed #9706

This commit is contained in:
N1k145 2016-06-25 13:03:24 +02:00 committed by GitHub
parent e21c26daf9
commit caac41969f

View File

@ -31,6 +31,9 @@ class OpenloadIE(InfoExtractor):
}, {
'url': 'https://openload.io/f/ZAn6oz-VZGE/',
'only_matching': True,
}, {
'url': 'https://openload.co/f/_-ztPaZtMhM/',
'only_matching': True,
}, {
# unavailable via https://openload.co/f/Sxz5sADo82g/, different layout
# for title and ext
@ -92,6 +95,14 @@ class OpenloadIE(InfoExtractor):
ret += compat_chr(int(m.group(1), 16))
return cls.openload_level2(ret)
@classmethod
def getLinkNo(cls, code):
#Solving welikekodi_ya_rly
codeS = code.split( )
return int(float(codeS[2]) - float(codeS[4][:-1]))
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
@ -99,10 +110,26 @@ class OpenloadIE(InfoExtractor):
if 'File not found' in webpage:
raise ExtractorError('File not found', expected=True)
code = self._search_regex(
#There are two links
#welikekodi_ya_rly defines with link is the correct one
linkNoCode = self._search_regex(
r'</video>\s*</div>\s*<script[^>]+>([^<]+)</script>',
webpage, 'JS code')
linkNo = self.getLinkNo(linkNoCode)
if linkNo == 1:
code = self._search_regex(
r'</video>\s*</div>\s*<script[^>]+>[^>]+</script>\s*<script[^>]+>[^<]+</script>\s*<script[^>]+>([^<]+)</script>',
webpage, 'JS code')
elif linkNo == 2:
code = self._search_regex(
r'</video>\s*</div>\s*<script[^>]+>[^>]+</script>\s*<script[^>]+>[^<]+</script>\s*<script[^>]+>[^<]+</script>\s*<script[^>]+>([^<]+)</script>',
webpage, 'JS code')
else:
ExtractorError('Error in link extraction', expected=True)
decoded = self.openload_decode(code)
video_url = self._search_regex(