mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-26 04:02:11 +00:00
[eagleplatform] Add support for another embed pattern (#13557)
This commit is contained in:
parent
15237fcd51
commit
5af2fd7fa0
1 changed files with 30 additions and 6 deletions
|
@ -60,16 +60,40 @@ class EaglePlatformIE(InfoExtractor):
|
||||||
webpage)
|
webpage)
|
||||||
if mobj is not None:
|
if mobj is not None:
|
||||||
return mobj.group('url')
|
return mobj.group('url')
|
||||||
# Basic usage embedding (see http://dultonmedia.github.io/eplayer/)
|
PLAYER_JS_RE = r'''
|
||||||
|
<script[^>]+
|
||||||
|
src=(?P<qjs>["\'])(?:https?:)?//(?P<host>(?:(?!(?P=qjs)).)+\.media\.eagleplatform\.com)/player/player\.js(?P=qjs)
|
||||||
|
.+?
|
||||||
|
'''
|
||||||
|
# "Basic usage" embedding (see http://dultonmedia.github.io/eplayer/)
|
||||||
mobj = re.search(
|
mobj = re.search(
|
||||||
r'''(?xs)
|
r'''(?xs)
|
||||||
<script[^>]+
|
%s
|
||||||
src=(?P<q1>["\'])(?:https?:)?//(?P<host>.+?\.media\.eagleplatform\.com)/player/player\.js(?P=q1)
|
|
||||||
.+?
|
|
||||||
<div[^>]+
|
<div[^>]+
|
||||||
class=(?P<q2>["\'])eagleplayer(?P=q2)[^>]+
|
class=(?P<qclass>["\'])eagleplayer(?P=qclass)[^>]+
|
||||||
data-id=["\'](?P<id>\d+)
|
data-id=["\'](?P<id>\d+)
|
||||||
''', webpage)
|
''' % PLAYER_JS_RE, webpage)
|
||||||
|
if mobj is not None:
|
||||||
|
return 'eagleplatform:%(host)s:%(id)s' % mobj.groupdict()
|
||||||
|
# Generalization of "Javascript code usage", "Combined usage" and
|
||||||
|
# "Usage without attaching to DOM" embeddings (see
|
||||||
|
# http://dultonmedia.github.io/eplayer/)
|
||||||
|
mobj = re.search(
|
||||||
|
r'''(?xs)
|
||||||
|
%s
|
||||||
|
<script>
|
||||||
|
.+?
|
||||||
|
new\s+EaglePlayer\(
|
||||||
|
(?:[^,]+\s*,\s*)?
|
||||||
|
{
|
||||||
|
.+?
|
||||||
|
\bid\s*:\s*["\']?(?P<id>\d+)
|
||||||
|
.+?
|
||||||
|
}
|
||||||
|
\s*\)
|
||||||
|
.+?
|
||||||
|
</script>
|
||||||
|
''' % PLAYER_JS_RE, webpage)
|
||||||
if mobj is not None:
|
if mobj is not None:
|
||||||
return 'eagleplatform:%(host)s:%(id)s' % mobj.groupdict()
|
return 'eagleplatform:%(host)s:%(id)s' % mobj.groupdict()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue