1 from __future__ import unicode_literals
3 from .common import InfoExtractor
10 class MinistryGridIE(InfoExtractor):
11 _VALID_URL = r'https?://(?:www\.)?ministrygrid\.com/([^/?#]*/)*(?P<id>[^/#?]+)/?(?:$|[?#])'
14 'url': 'http://www.ministrygrid.com/training-viewer/-/training/t4g-2014-conference/the-gospel-by-numbers-4/the-gospel-by-numbers',
15 'md5': '844be0d2a1340422759c2a9101bab017',
17 'id': '3453494717001',
19 'title': 'The Gospel by Numbers',
20 'thumbnail': 're:^https?://.*\.jpg',
21 'upload_date': '20140410',
22 'description': 'Coming soon from T4G 2014!',
23 'uploader_id': '2034960640001',
24 'timestamp': 1397145591,
28 'skip_download': True,
30 'add_ie': ['TDSLifeway'],
33 def _real_extract(self, url):
34 video_id = self._match_id(url)
36 webpage = self._download_webpage(url, video_id)
37 portlets = self._parse_json(self._search_regex(
38 r'Liferay\.Portlet\.list=(\[.+?\])', webpage, 'portlet list'),
40 pl_id = self._search_regex(
41 r'getPlid:function\(\){return"(\d+)"}', webpage, 'p_l_id')
43 for i, portlet in enumerate(portlets):
44 portlet_url = 'http://www.ministrygrid.com/c/portal/render_portlet?p_l_id=%s&p_p_id=%s' % (pl_id, portlet)
45 portlet_code = self._download_webpage(
46 portlet_url, video_id,
47 note='Looking in portlet %s (%d/%d)' % (portlet, i + 1, len(portlets)),
49 video_iframe_url = self._search_regex(
50 r'<iframe.*?src="([^"]+)"', portlet_code, 'video iframe',
53 return self.url_result(
54 smuggle_url(video_iframe_url, {'force_videoid': video_id}),
57 raise ExtractorError('Could not find video iframe in any portlets')