1 from .common
import InfoExtractor
11 class DailyWireBaseIE(InfoExtractor
):
13 'episode': ('props', 'pageProps', 'episodeData', 'episode'),
14 'videos': ('props', 'pageProps', 'videoData', 'video'),
15 'podcasts': ('props', 'pageProps', 'episode'),
18 def _get_json(self
, url
):
19 sites_type
, slug
= self
._match
_valid
_url
(url
).group('sites_type', 'id')
20 json_data
= self
._search
_nextjs
_data
(self
._download
_webpage
(url
, slug
), slug
)
21 return slug
, traverse_obj(json_data
, self
._JSON
_PATH
[sites_type
])
24 class DailyWireIE(DailyWireBaseIE
):
25 _VALID_URL
= r
'https?://(?:www\.)dailywire(?:\.com)/(?P<sites_type>episode|videos)/(?P<id>[\w-]+)'
27 'url': 'https://www.dailywire.com/episode/1-fauci',
29 'id': 'ckzsl50xnqpy30850in3v4bu7',
31 'display_id': '1-fauci',
33 'description': 'md5:9df630347ef85081b7e97dd30bc22853',
34 'thumbnail': 'https://daily-wire-production.imgix.net/episodes/ckzsl50xnqpy30850in3v4bu7/ckzsl50xnqpy30850in3v4bu7-1648237399554.jpg',
35 'creator': 'Caroline Roberts',
36 'series_id': 'ckzplm0a097fn0826r2vc3j7h',
37 'series': 'China: The Enemy Within',
40 'url': 'https://www.dailywire.com/episode/ep-124-bill-maher',
42 'id': 'cl0ngbaalplc80894sfdo9edf',
44 'display_id': 'ep-124-bill-maher',
45 'title': 'Ep. 124 - Bill Maher',
46 'thumbnail': 'https://daily-wire-production.imgix.net/episodes/cl0ngbaalplc80894sfdo9edf/cl0ngbaalplc80894sfdo9edf-1647065568518.jpg',
47 'creator': 'Caroline Roberts',
48 'description': 'md5:adb0de584bcfa9c41374999d9e324e98',
49 'series_id': 'cjzvep7270hp00786l9hwccob',
50 'series': 'The Sunday Special',
53 'url': 'https://www.dailywire.com/videos/the-hyperions',
54 'only_matching': True,
57 def _real_extract(self
, url
):
58 slug
, episode_info
= self
._get
_json
(url
)
60 episode_info
, (('segments', 'videoUrl'), ..., ('video', 'audio')), expected_type
=url_or_none
)
62 formats
, subtitles
= [], {}
64 if determine_ext(url
) != 'm3u8':
65 formats
.append({'url': url
})
67 format_
, subs_
= self
._extract
_m
3u8_formats
_and
_subtitles
(url
, slug
)
68 formats
.extend(format_
)
69 self
._merge
_subtitles
(subs_
, target
=subtitles
)
71 'id': episode_info
['id'],
73 'title': traverse_obj(episode_info
, 'title', 'name'),
74 'description': episode_info
.get('description'),
75 'creator': join_nonempty(('createdBy', 'firstName'), ('createdBy', 'lastName'), from_dict
=episode_info
, delim
=' '),
76 'duration': float_or_none(episode_info
.get('duration')),
77 'is_live': episode_info
.get('isLive'),
78 'thumbnail': traverse_obj(episode_info
, 'thumbnail', 'image', expected_type
=url_or_none
),
80 'subtitles': subtitles
,
81 'series_id': traverse_obj(episode_info
, ('show', 'id')),
82 'series': traverse_obj(episode_info
, ('show', 'name')),
86 class DailyWirePodcastIE(DailyWireBaseIE
):
87 _VALID_URL
= r
'https?://(?:www\.)dailywire(?:\.com)/(?P<sites_type>podcasts)/(?P<podcaster>[\w-]+/(?P<id>[\w-]+))'
89 'url': 'https://www.dailywire.com/podcasts/morning-wire/get-ready-for-recession-6-15-22',
91 'id': 'cl4f01d0w8pbe0a98ydd0cfn1',
93 'display_id': 'get-ready-for-recession-6-15-22',
94 'title': 'Get Ready for Recession | 6.15.22',
95 'description': 'md5:c4afbadda4e1c38a4496f6d62be55634',
96 'thumbnail': 'https://daily-wire-production.imgix.net/podcasts/ckx4otgd71jm508699tzb6hf4-1639506575562.jpg',
97 'duration': 900.117667,
101 def _real_extract(self
, url
):
102 slug
, episode_info
= self
._get
_json
(url
)
103 audio_id
= traverse_obj(episode_info
, 'audioMuxPlaybackId', 'VUsAipTrBVSgzw73SpC2DAJD401TYYwEp')
106 'id': episode_info
['id'],
107 'url': f
'https://stream.media.dailywire.com/{audio_id}/audio.m4a',
109 'title': episode_info
.get('title'),
110 'duration': float_or_none(episode_info
.get('duration')),
111 'thumbnail': episode_info
.get('thumbnail'),
112 'description': episode_info
.get('description'),