mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-25 19:52:11 +00:00
[condenast] fallback to loader.js if video.js fail
This commit is contained in:
parent
491c42e690
commit
e563c0d73b
1 changed files with 11 additions and 3 deletions
|
@ -113,11 +113,19 @@ class CondeNastIE(InfoExtractor):
|
||||||
'target': params['id'],
|
'target': params['id'],
|
||||||
})
|
})
|
||||||
video_id = query['videoId']
|
video_id = query['videoId']
|
||||||
|
video_info = None
|
||||||
info_page = self._download_webpage(
|
info_page = self._download_webpage(
|
||||||
'http://player.cnevids.com/player/video.js',
|
'http://player.cnevids.com/player/video.js',
|
||||||
video_id, 'Downloading video info', query=query)
|
video_id, 'Downloading video info', query=query, fatal=False)
|
||||||
video_info = self._parse_json(self._search_regex(
|
if info_page:
|
||||||
r'loadCallback\(({.+})\)', info_page, 'video info'), video_id)['video']
|
video_info = self._parse_json(self._search_regex(
|
||||||
|
r'loadCallback\(({.+})\)', info_page, 'video info'), video_id)['video']
|
||||||
|
else:
|
||||||
|
info_page = self._download_webpage(
|
||||||
|
'http://player.cnevids.com/player/loader.js',
|
||||||
|
video_id, 'Downloading loader info', query=query)
|
||||||
|
video_info = self._parse_json(self._search_regex(
|
||||||
|
r'var\s+video\s*=\s*({.+?});', info_page, 'video info'), video_id)
|
||||||
title = video_info['title']
|
title = video_info['title']
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
|
|
Loading…
Reference in a new issue