]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/godtv.py
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,
34 'url': 'http://god.tv/liveevents',
35 'only_matching': True,
38 def _real_extract(self
, url
):
39 display_id
= self
._match
_id
(url
)
41 webpage
= self
._download
_webpage
(url
, display_id
)
43 settings
= self
._parse
_json
(
45 r
'jQuery\.extend\(Drupal\.settings\s*,\s*({.+?})\);',
46 webpage
, 'settings', default
='{}'),
47 display_id
, transform_source
=js_to_json
, fatal
=False)
52 playlist
= settings
.get('playlist')
53 if playlist
and isinstance(playlist
, list):
55 OoyalaIE
._build
_url
_result
(video
['content_id'])
56 for video
in playlist
if video
.get('content_id')]
58 return self
.playlist_result(entries
, display_id
)
59 ooyala_id
= settings
.get('ooyala', {}).get('content_id')
62 ooyala_id
= self
._search
_regex
(
63 r
'["\']content_id
["\']\s*:\s*(["\'])(?P
<id>[\w
-]+)\
1',
64 webpage, 'ooyala
id', group='id')
66 return OoyalaIE._build_url_result(ooyala_id)