1 from .common
import InfoExtractor
8 class MinistryGridIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?ministrygrid\.com/([^/?#]*/)*(?P<id>[^/#?]+)/?(?:$|[?#])'
12 'url': 'http://www.ministrygrid.com/training-viewer/-/training/t4g-2014-conference/the-gospel-by-numbers-4/the-gospel-by-numbers',
13 'md5': '844be0d2a1340422759c2a9101bab017',
15 'id': '3453494717001',
17 'title': 'The Gospel by Numbers',
18 'thumbnail': r
're:^https?://.*\.jpg',
19 'upload_date': '20140410',
20 'description': 'Coming soon from T4G 2014!',
21 'uploader_id': '2034960640001',
22 'timestamp': 1397145591,
26 'skip_download': True,
28 'add_ie': ['TDSLifeway'],
31 def _real_extract(self
, url
):
32 video_id
= self
._match
_id
(url
)
34 webpage
= self
._download
_webpage
(url
, video_id
)
35 portlets
= self
._parse
_json
(self
._search
_regex
(
36 r
'Liferay\.Portlet\.list=(\[.+?\])', webpage
, 'portlet list'),
38 pl_id
= self
._search
_regex
(
39 r
'getPlid:function\(\){return"(\d+)"}', webpage
, 'p_l_id')
41 for i
, portlet
in enumerate(portlets
):
42 portlet_url
= 'http://www.ministrygrid.com/c/portal/render_portlet?p_l_id=%s&p_p_id=%s' % (pl_id
, portlet
)
43 portlet_code
= self
._download
_webpage
(
44 portlet_url
, video_id
,
45 note
='Looking in portlet %s (%d/%d)' % (portlet
, i
+ 1, len(portlets
)),
47 video_iframe_url
= self
._search
_regex
(
48 r
'<iframe.*?src="([^"]+)"', portlet_code
, 'video iframe',
51 return self
.url_result(
52 smuggle_url(video_iframe_url
, {'force_videoid': video_id
}),
55 raise ExtractorError('Could not find video iframe in any portlets')