1 from __future__ import unicode_literals
3 from .common import InfoExtractor
4 from .ooyala import OoyalaIE
5 from ..utils import js_to_json
8 class GodTVIE(InfoExtractor):
9 _VALID_URL = r'https?://(?:www\.)?god\.tv(?:/[^/]+)+/(?P<id>[^/?#&]+)'
11 'url': 'http://god.tv/jesus-image/video/jesus-conference-2016/randy-needham',
13 'id': 'lpd3g2MzE6D1g8zFAKz8AGpxWcpu6o_3',
15 'title': 'Randy Needham',
19 'skip_download': True,
22 'url': 'http://god.tv/playlist/bible-study',
26 'playlist_mincount': 37,
28 'url': 'http://god.tv/node/15097',
29 'only_matching': True,
31 'url': 'http://god.tv/live/africa',
32 'only_matching': True,
35 def _real_extract(self, url):
36 display_id = self._match_id(url)
38 webpage = self._download_webpage(url, display_id)
40 settings = self._parse_json(
42 r'jQuery\.extend\(Drupal\.settings\s*,\s*({.+?})\);',
43 webpage, 'settings', default='{}'),
44 display_id, transform_source=js_to_json, fatal=False)
49 playlist = settings.get('playlist')
50 if playlist and isinstance(playlist, list):
52 OoyalaIE._build_url_result(video['content_id'])
53 for video in playlist if video.get('content_id')]
55 return self.playlist_result(entries, display_id)
56 ooyala_id = settings.get('ooyala', {}).get('content_id')
59 ooyala_id = self._search_regex(
60 r'["\']content_id["\']\s*:\s*(["\'])(?P<id>[\w-]+)\1',
61 webpage, 'ooyala id', group='id')
63 return OoyalaIE._build_url_result(ooyala_id)