mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-22 16:57:40 +00:00
[nexx] Improve JS embed extraction
This commit is contained in:
parent
decf86044d
commit
089b97cfee
1 changed files with 11 additions and 7 deletions
|
@ -72,13 +72,17 @@ class NexxIE(InfoExtractor):
|
|||
entries = []
|
||||
|
||||
# JavaScript Integration
|
||||
for domain_id, video_id in re.findall(
|
||||
r'''(?isx)
|
||||
<script\b[^>]+\bsrc=["\']https?://require\.nexx(?:\.cloud|cdn\.com)/(\d+).+?
|
||||
onPLAYReady.+?
|
||||
_play\.init\s*\(.+?\s*,\s*(\d+)\s*,\s*.+?\)
|
||||
''', webpage):
|
||||
entries.append('https://api.nexx.cloud/v3/%s/videos/byid/%s' % (domain_id, video_id))
|
||||
mobj = re.search(
|
||||
r'<script\b[^>]+\bsrc=["\']https?://require\.nexx(?:\.cloud|cdn\.com)/(?P<id>\d+)',
|
||||
webpage)
|
||||
if mobj:
|
||||
domain_id = mobj.group('id')
|
||||
for video_id in re.findall(
|
||||
r'(?is)onPLAYReady.+?_play\.init\s*\(.+?\s*,\s*["\']?(\d+)',
|
||||
webpage):
|
||||
entries.append(
|
||||
'https://api.nexx.cloud/v3/%s/videos/byid/%s'
|
||||
% (domain_id, video_id))
|
||||
|
||||
# TODO: support more embed formats
|
||||
|
||||
|
|
Loading…
Reference in a new issue