1 from .common
import InfoExtractor
9 class TheInterceptIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://theintercept\.com/fieldofvision/(?P<id>[^/?#]+)'
12 'url': 'https://theintercept.com/fieldofvision/thisisacoup-episode-four-surrender-or-die/',
13 'md5': '145f28b41d44aab2f87c0a4ac8ec95bd',
17 'title': '#ThisIsACoup – Episode Four: Surrender or Die',
18 'description': 'md5:74dd27f0e2fbd50817829f97eaa33140',
19 'timestamp': 1450429239,
20 'upload_date': '20151218',
25 def _real_extract(self
, url
):
26 display_id
= self
._match
_id
(url
)
27 webpage
= self
._download
_webpage
(url
, display_id
)
29 json_data
= self
._parse
_json
(self
._search
_regex
(
30 r
'initialStoreTree\s*=\s*(?P<json_data>{.+})', webpage
,
31 'initialStoreTree'), display_id
)
33 for post
in json_data
['resources']['posts'].values():
34 if post
['slug'] == display_id
:
36 '_type': 'url_transparent',
37 'url': 'jwplatform:{}'.format(post
['fov_videoid']),
38 'id': str(post
['ID']),
39 'display_id': display_id
,
40 'title': post
['title'],
41 'description': post
.get('excerpt'),
42 'timestamp': parse_iso8601(post
.get('date')),
43 'comment_count': int_or_none(post
.get('comments_number')),
45 raise ExtractorError('Unable to find the current post')