]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/theintercept.py
1 from .common
import InfoExtractor
2 from ..compat
import compat_str
10 class TheInterceptIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://theintercept\.com/fieldofvision/(?P<id>[^/?#]+)'
13 'url': 'https://theintercept.com/fieldofvision/thisisacoup-episode-four-surrender-or-die/',
14 'md5': '145f28b41d44aab2f87c0a4ac8ec95bd',
18 'title': '#ThisIsACoup – Episode Four: Surrender or Die',
19 'description': 'md5:74dd27f0e2fbd50817829f97eaa33140',
20 'timestamp': 1450429239,
21 'upload_date': '20151218',
26 def _real_extract(self
, url
):
27 display_id
= self
._match
_id
(url
)
28 webpage
= self
._download
_webpage
(url
, display_id
)
30 json_data
= self
._parse
_json
(self
._search
_regex
(
31 r
'initialStoreTree\s*=\s*(?P<json_data>{.+})', webpage
,
32 'initialStoreTree'), display_id
)
34 for post
in json_data
['resources']['posts'].values():
35 if post
['slug'] == display_id
:
37 '_type': 'url_transparent',
38 'url': 'jwplatform:%s' % post
['fov_videoid'],
39 'id': compat_str(post
['ID']),
40 'display_id': display_id
,
41 'title': post
['title'],
42 'description': post
.get('excerpt'),
43 'timestamp': parse_iso8601(post
.get('date')),
44 'comment_count': int_or_none(post
.get('comments_number')),
46 raise ExtractorError('Unable to find the current post')