1 from .common
import InfoExtractor
8 from ..utils
.traversal
import traverse_obj
11 class ERRJupiterIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:jupiter(?:pluss)?|lasteekraan)\.err\.ee/(?P<id>\d+)'
14 'note': 'Jupiter: Movie: siin-me-oleme',
15 'url': 'https://jupiter.err.ee/1211107/siin-me-oleme',
16 'md5': '9b45d1682a98853acaa1e1b0c791f425',
20 'title': 'Siin me oleme!',
22 'description': 'md5:1825b795f5f7584241aeb59e5bbb4f70',
23 'release_date': '20231226',
24 'upload_date': '20201217',
25 'modified_date': '20201217',
26 'release_timestamp': 1703577600,
27 'timestamp': 1608210000,
28 'modified_timestamp': 1608220800,
32 'note': 'Jupiter: Series: Impulss',
33 'url': 'https://jupiter.err.ee/1609145945/impulss',
34 'md5': 'a378486df07ed1ba74e46cc861886243',
39 'alt_title': 'Loteriipilet hooldekodusse',
40 'description': 'md5:fa8a2ed0cdccb130211513443ee4d571',
41 'release_date': '20231107',
42 'upload_date': '20231026',
43 'modified_date': '20231118',
44 'release_timestamp': 1699380000,
45 'timestamp': 1698327601,
46 'modified_timestamp': 1700311802,
50 'episode': 'Loteriipilet hooldekodusse',
52 'series_id': '1609108187',
54 'episode_id': '1609145945',
57 'note': 'Jupiter: Radio Show: mnemoturniir episode',
58 'url': 'https://jupiter.err.ee/1037919/mnemoturniir',
59 'md5': 'f1eb95fe66f9620ff84e81bbac37076a',
63 'title': 'Mnemoturniir',
65 'description': 'md5:626db52394e7583c26ab74d6a34d9982',
66 'release_date': '20240121',
67 'upload_date': '20240108',
68 'modified_date': '20240121',
69 'release_timestamp': 1705827900,
70 'timestamp': 1704675602,
71 'modified_timestamp': 1705827601,
72 'series': 'Mnemoturniir',
75 'episode': 'Episode 0',
77 'series_id': '1037919',
79 'episode_id': '1609215101',
82 'note': 'Jupiter+: Clip: bolee-zelenyj-tallinn',
83 'url': 'https://jupiterpluss.err.ee/1609180445/bolee-zelenyj-tallinn',
84 'md5': '1b812270c4daf6ce51c06bfeaf33ed95',
88 'title': 'Более зеленый Таллинн',
90 'description': 'md5:fd34d9bf939c28c4a725b19a7f0d6320',
91 'release_date': '20231224',
92 'upload_date': '20231130',
93 'modified_date': '20231207',
94 'release_timestamp': 1703423400,
95 'timestamp': 1701338400,
96 'modified_timestamp': 1701967200,
100 'note': 'Jupiter+: Series: The Sniffer',
101 'url': 'https://jupiterpluss.err.ee/1608311387/njuhach',
102 'md5': '2abdeb7131ce551bce49e8d0cea08536',
108 'description': 'md5:8c5c7d8f32ec6e54cd498c9e59ca83bc',
109 'release_date': '20230601',
110 'upload_date': '20210818',
111 'modified_date': '20210903',
112 'release_timestamp': 1685633400,
113 'timestamp': 1629318000,
114 'modified_timestamp': 1630686000,
115 'release_year': 2013,
116 'episode': 'Episode 1',
117 'episode_id': '1608311390',
119 'season': 'Season 1',
122 'series_id': '1608311387',
125 'note': 'Jupiter+: Podcast: lesnye-istorii-aisty',
126 'url': 'https://jupiterpluss.err.ee/1608990335/lesnye-istorii-aisty',
127 'md5': '8b46d7e4510b254a14b7a52211b5bf96',
131 'title': 'Лесные истории | Аисты',
133 'description': 'md5:065e721623e271e7a63e6540d409ca6b',
134 'release_date': '20230609',
135 'upload_date': '20230527',
136 'modified_date': '20230608',
137 'release_timestamp': 1686308700,
138 'timestamp': 1685145600,
139 'modified_timestamp': 1686252600,
140 'release_year': 2023,
141 'episode': 'Episode 0',
142 'episode_id': '1608990335',
144 'season': 'Season 0',
146 'series': 'Лесные истории | Аисты',
147 'series_id': '1037497',
150 'note': 'Lasteekraan: Pätu',
151 'url': 'https://lasteekraan.err.ee/1092243/patu',
152 'md5': 'a67eb9b9bcb3d201718c15d1638edf77',
158 'description': 'md5:64a7b5a80afd7042d3f8ec48c77befd9',
159 'release_date': '20230614',
160 'upload_date': '20200520',
161 'modified_date': '20200520',
162 'release_timestamp': 1686745800,
163 'timestamp': 1589975640,
164 'modified_timestamp': 1589975640,
165 'release_year': 1990,
166 'episode': 'Episode 1',
167 'episode_id': '1092243',
169 'season': 'Season 1',
172 'series_id': '1092236',
176 def _real_extract(self
, url
):
177 video_id
= self
._match
_id
(url
)
178 data
= self
._download
_json
(
179 'https://services.err.ee/api/v2/vodContent/getContentPageData', video_id
,
180 query
={'contentId': video_id
})['data']['mainContent']
182 media_data
= traverse_obj(data
, ('medias', ..., {dict}
), get_all
=False)
183 if traverse_obj(media_data
, ('restrictions', 'drm', {bool}
)):
184 self
.report_drm(video_id
)
186 formats
, subtitles
= [], {}
187 for format_url
in set(traverse_obj(media_data
, ('src', ('hls', 'hls2', 'hlsNew'), {url_or_none}
))):
188 fmts
, subs
= self
._extract
_m
3u8_formats
_and
_subtitles
(
189 format_url
, video_id
, 'mp4', m3u8_id
='hls', fatal
=False)
191 self
._merge
_subtitles
(subs
, target
=subtitles
)
192 for format_url
in set(traverse_obj(media_data
, ('src', ('dash', 'dashNew'), {url_or_none}
))):
193 fmts
, subs
= self
._extract
_mpd
_formats
_and
_subtitles
(
194 format_url
, video_id
, mpd_id
='dash', fatal
=False)
196 self
._merge
_subtitles
(subs
, target
=subtitles
)
197 if format_url
:= traverse_obj(media_data
, ('src', 'file', {url_or_none}
)):
206 'subtitles': subtitles
,
207 **traverse_obj(data
, {
208 'title': ('heading', {str}
),
209 'alt_title': ('subHeading', {str}
),
210 'description': (('lead', 'body'), {clean_html}
, {lambda x
: x
or None}),
211 'timestamp': ('created', {int_or_none}
),
212 'modified_timestamp': ('updated', {int_or_none}
),
213 'release_timestamp': (('scheduleStart', 'publicStart'), {int_or_none}
),
214 'release_year': ('year', {int_or_none}
),
216 **(traverse_obj(data
, {
217 'series': ('heading', {str}
),
218 'series_id': ('rootContentId', {str_or_none}
),
219 'episode': ('subHeading', {str}
),
220 'season_number': ('season', {int_or_none}
),
221 'episode_number': ('episode', {int_or_none}
),
222 'episode_id': ('id', {str_or_none}
),
223 }) if data
.get('type') == 'episode' else {}),