parse_iso8601,
parse_qs,
qualities,
+ traverse_obj,
unified_strdate,
- xpath_text
+ xpath_text,
)
class EuropaIE(InfoExtractor):
+ _WORKING = False
_VALID_URL = r'https?://ec\.europa\.eu/avservices/(?:video/player|audio/audioDetails)\.cfm\?.*?\bref=(?P<id>[A-Za-z0-9-]+)'
_TESTS = [{
'url': 'http://ec.europa.eu/avservices/video/player.cfm?ref=I107758',
'duration': 34,
'view_count': int,
'formats': 'mincount:3',
- }
+ },
}, {
'url': 'http://ec.europa.eu/avservices/video/player.cfm?sitelang=en&ref=I107786',
'only_matching': True,
video_id = self._match_id(url)
playlist = self._download_xml(
- 'http://ec.europa.eu/avservices/video/player/playlist.cfm?ID=%s' % video_id, video_id)
+ f'http://ec.europa.eu/avservices/video/player/playlist.cfm?ID={video_id}', video_id)
def get_item(type_, preference):
items = {}
- for item in playlist.findall('./info/%s/item' % type_):
+ for item in playlist.findall(f'./info/{type_}/item'):
lang, label = xpath_text(item, 'lg', default=None), xpath_text(item, 'label', default=None)
if lang and label:
items[lang] = label.strip()
'url': video_url,
'format_id': lang,
'format_note': xpath_text(file_, './lglabel'),
- 'language_preference': language_preference(lang)
+ 'language_preference': language_preference(lang),
})
return {
'upload_date': upload_date,
'duration': duration,
'view_count': view_count,
- 'formats': formats
+ 'formats': formats,
}
class EuroParlWebstreamIE(InfoExtractor):
_VALID_URL = r'''(?x)
- https?://(?:multimedia|webstreaming)\.europarl\.europa\.eu/[^/#?]+/
- (?:embed/embed\.html\?event=|(?!video)[^/#?]+/[\w-]+_)(?P<id>[\w-]+)
+ https?://multimedia\.europarl\.europa\.eu/
+ (?:\w+/)?webstreaming/(?:[\w-]+_)?(?P<id>[\w-]+)
'''
_TESTS = [{
'url': 'https://multimedia.europarl.europa.eu/pl/webstreaming/plenary-session_20220914-0900-PLENARY',
'info_dict': {
- 'id': 'bcaa1db4-76ef-7e06-8da7-839bd0ad1dbe',
+ 'id': '62388b15-d85b-4add-99aa-ba12ccf64f0d',
+ 'display_id': '20220914-0900-PLENARY',
'ext': 'mp4',
- 'release_timestamp': 1663137900,
'title': 'Plenary session',
+ 'release_timestamp': 1663139069,
'release_date': '20220914',
},
'params': {
'skip_download': True,
- }
+ },
}, {
- 'url': 'https://multimedia.europarl.europa.eu/pl/webstreaming/eu-cop27-un-climate-change-conference-in-sharm-el-sheikh-egypt-ep-delegation-meets-with-ngo-represen_20221114-1600-SPECIAL-OTHER',
+ # live webstream
+ 'url': 'https://multimedia.europarl.europa.eu/en/webstreaming/euroscola_20221115-1000-SPECIAL-EUROSCOLA',
'info_dict': {
- 'id': 'a8428de8-b9cd-6a2e-11e4-3805d9c9ff5c',
'ext': 'mp4',
- 'release_timestamp': 1668434400,
- 'release_date': '20221114',
- 'title': 'md5:d3550280c33cc70e0678652e3d52c028',
+ 'id': '510eda7f-ba72-161b-7ee7-0e836cd2e715',
+ 'release_timestamp': 1668502800,
+ 'title': 'Euroscola 2022-11-15 19:21',
+ 'release_date': '20221115',
+ 'live_status': 'is_live',
},
- 'params': {
- 'skip_download': True,
- }
+ 'skip': 'not live anymore',
}, {
- # embed webpage
- 'url': 'https://webstreaming.europarl.europa.eu/ep/embed/embed.html?event=20220914-0900-PLENARY&language=en&autoplay=true&logo=true',
+ 'url': 'https://multimedia.europarl.europa.eu/en/webstreaming/committee-on-culture-and-education_20230301-1130-COMMITTEE-CULT',
'info_dict': {
- 'id': 'bcaa1db4-76ef-7e06-8da7-839bd0ad1dbe',
+ 'id': '7355662c-8eac-445e-4bb9-08db14b0ddd7',
+ 'display_id': '20230301-1130-COMMITTEE-CULT',
'ext': 'mp4',
- 'title': 'Plenary session',
- 'release_date': '20220914',
- 'release_timestamp': 1663137900,
+ 'release_date': '20230301',
+ 'title': 'Committee on Culture and Education',
+ 'release_timestamp': 1677666641,
},
- 'params': {
- 'skip_download': True,
- }
}, {
- # live webstream
- 'url': 'https://multimedia.europarl.europa.eu/en/webstreaming/euroscola_20221115-1000-SPECIAL-EUROSCOLA',
+ # live stream
+ 'url': 'https://multimedia.europarl.europa.eu/en/webstreaming/committee-on-environment-public-health-and-food-safety_20230524-0900-COMMITTEE-ENVI',
'info_dict': {
+ 'id': 'e4255f56-10aa-4b3c-6530-08db56d5b0d9',
'ext': 'mp4',
- 'id': '510eda7f-ba72-161b-7ee7-0e836cd2e715',
- 'release_timestamp': 1668502800,
- 'title': 'Euroscola 2022-11-15 19:21',
- 'release_date': '20221115',
+ 'release_date': '20230524',
+ 'title': r're:Committee on Environment, Public Health and Food Safety \d{4}-\d{2}-\d{2}\s\d{2}:\d{2}',
+ 'release_timestamp': 1684911541,
'live_status': 'is_live',
},
- 'skip': 'not live anymore'
+ 'skip': 'Not live anymore',
+ }, {
+ 'url': 'https://multimedia.europarl.europa.eu/en/webstreaming/20240320-1345-SPECIAL-PRESSER',
+ 'info_dict': {
+ 'id': 'c1f11567-5b52-470a-f3e1-08dc3c216ace',
+ 'display_id': '20240320-1345-SPECIAL-PRESSER',
+ 'ext': 'mp4',
+ 'release_date': '20240320',
+ 'title': 'md5:7c6c814cac55dea5e2d87bf8d3db2234',
+ 'release_timestamp': 1710939767,
+ },
+ }, {
+ 'url': 'https://multimedia.europarl.europa.eu/webstreaming/briefing-for-media-on-2024-european-elections_20240429-1000-SPECIAL-OTHER',
+ 'only_matching': True,
}]
def _real_extract(self, url):
display_id = self._match_id(url)
+ webpage = self._download_webpage(url, display_id)
+
+ webpage_nextjs = self._search_nextjs_data(webpage, display_id)['props']['pageProps']
json_info = self._download_json(
- 'https://vis-api.vuplay.co.uk/event/external', display_id,
+ 'https://acs-api.europarl.connectedviews.eu/api/FullMeeting', display_id,
query={
- 'player_key': 'europarl|718f822c-a48c-4841-9947-c9cb9bb1743c',
- 'external_id': display_id,
+ 'api-version': 1.0,
+ 'tenantId': 'bae646ca-1fc8-4363-80ba-2c04f06b4968',
+ 'externalReference': display_id,
})
- formats, subtitles = self._extract_mpd_formats_and_subtitles(json_info['streaming_url'], display_id)
- fmts, subs = self._extract_m3u8_formats_and_subtitles(
- json_info['streaming_url'].replace('.mpd', '.m3u8'), display_id)
-
- formats.extend(fmts)
- self._merge_subtitles(subs, target=subtitles)
+ formats, subtitles = [], {}
+ for hls_url in traverse_obj(json_info, ((('meetingVideo'), ('meetingVideos', ...)), 'hlsUrl')):
+ fmt, subs = self._extract_m3u8_formats_and_subtitles(hls_url, display_id)
+ formats.extend(fmt)
+ self._merge_subtitles(subs, target=subtitles)
return {
'id': json_info['id'],
- 'title': json_info.get('title'),
+ 'display_id': display_id,
+ 'title': traverse_obj(webpage_nextjs, (('mediaItem', 'title'), ('title', )), get_all=False),
'formats': formats,
'subtitles': subtitles,
- 'release_timestamp': parse_iso8601(json_info.get('published_start')),
- 'is_live': 'LIVE' in json_info.get('state', '')
+ 'release_timestamp': parse_iso8601(json_info.get('startDateTime')),
+ 'is_live': traverse_obj(webpage_nextjs, ('mediaItem', 'mediaSubType')) == 'Live',
}