1 from .common
import InfoExtractor
8 class NewsyIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?newsy\.com/stories/(?P<id>[^/?#$&]+)'
12 'url': 'https://www.newsy.com/stories/nft-trend-leads-to-fraudulent-art-auctions/',
14 'id': '609d65125b086c24fb529312',
16 'title': 'NFT Art Auctions Have A Piracy Problem',
17 'description': 'md5:971e52ab8bc97e50305475cde8284c83',
18 'display_id': 'nft-trend-leads-to-fraudulent-art-auctions',
19 'timestamp': 1621339200,
21 'thumbnail': 'https://cdn.newsy.com/images/videos/x/1620927824_xyrrP4.jpg',
22 'upload_date': '20210518',
24 'params': {'skip_download': True},
27 def _real_extract(self
, url
):
28 display_id
= self
._match
_id
(url
)
29 webpage
= self
._download
_webpage
(url
, display_id
)
30 data_json
= self
._parse
_json
(self
._html
_search
_regex
(
31 r
'data-video-player\s?=\s?"({[^"]+})">', webpage
, 'data'), display_id
, js_to_json
)
32 ld_json
= self
._search
_json
_ld
(webpage
, display_id
, fatal
=False)
34 formats
, subtitles
= [], {}
35 if data_json
.get('stream'):
36 fmts
, subs
= self
._extract
_m
3u8_formats
_and
_subtitles
(data_json
['stream'], display_id
)
38 subtitles
= self
._merge
_subtitles
(subtitles
, subs
)
39 return merge_dicts(ld_json
, {
40 'id': data_json
['id'],
41 'display_id': display_id
,
42 'title': data_json
.get('headline'),
43 'duration': data_json
.get('duration'),
44 'thumbnail': data_json
.get('image'),
46 'subtitles': subtitles
,