diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-08-23 07:22:14 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-08-23 07:22:14 +0700 |
commit | 3083e4dc070d6378456f9b20ebd5cbf9ee9d92af (patch) | |
tree | 16889ef34f878ffe02afce9f882013513a761e4d /youtube_dl/extractor | |
parent | 7367bdef23a3db4691ba99f01613b7759340f05e (diff) |
[eagleplatform] Improve detection of embedded videos (Closes #10409)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/eagleplatform.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/youtube_dl/extractor/eagleplatform.py b/youtube_dl/extractor/eagleplatform.py index 12d28d3b9..d4dfda8cd 100644 --- a/youtube_dl/extractor/eagleplatform.py +++ b/youtube_dl/extractor/eagleplatform.py @@ -52,11 +52,24 @@ class EaglePlatformIE(InfoExtractor): @staticmethod def _extract_url(webpage): + # Regular iframe embedding mobj = re.search( r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//.+?\.media\.eagleplatform\.com/index/player\?.+?)\1', webpage) if mobj is not None: return mobj.group('url') + # Basic usage embedding (see http://dultonmedia.github.io/eplayer/) + mobj = re.search( + r'''(?xs) + <script[^>]+ + src=(?P<q1>["\'])(?:https?:)?//(?P<host>.+?\.media\.eagleplatform\.com)/player/player\.js(?P=q1) + .+? + <div[^>]+ + class=(?P<q2>["\'])eagleplayer(?P=q2)[^>]+ + data-id=["\'](?P<id>\d+) + ''', webpage) + if mobj is not None: + return 'eagleplatform:%(host)s:%(id)s' % mobj.groupdict() @staticmethod def _handle_error(response): |