From b41a9e66af0f08f080819bb6b8a4a5837139449a Mon Sep 17 00:00:00 2001 From: DTrombett Date: Fri, 28 Mar 2025 20:06:46 +0100 Subject: [PATCH] Revert EuroParlWebstreamIE changes --- yt_dlp/extractor/europa.py | 140 ++++++++++++------------------------- 1 file changed, 45 insertions(+), 95 deletions(-) diff --git a/yt_dlp/extractor/europa.py b/yt_dlp/extractor/europa.py index d39a0c615..48b7d89f0 100644 --- a/yt_dlp/extractor/europa.py +++ b/yt_dlp/extractor/europa.py @@ -1,6 +1,5 @@ from .common import InfoExtractor from ..utils import ( - int_or_none, parse_iso8601, str_or_none, traverse_obj, @@ -98,103 +97,64 @@ def _real_extract(self, url): class EuroParlWebstreamIE(InfoExtractor): _VALID_URL = r'''(?x) https?://multimedia\.europarl\.europa\.eu/ - (?:[^/]*/)?webstreaming/(?:[^_]*_)?(?P[\w-]+) + (?:\w+/)?webstreaming/(?:[\w-]+_)?(?P[\w-]+) ''' _TESTS = [{ 'url': 'https://multimedia.europarl.europa.eu/pl/webstreaming/plenary-session_20220914-0900-PLENARY', - 'md5': '16420ad9c602663759538ac1ca16a8db', 'info_dict': { - 'id': '20220914-0900-PLENARY', + 'id': '62388b15-d85b-4add-99aa-ba12ccf64f0d', + 'display_id': '20220914-0900-PLENARY', 'ext': 'mp4', 'title': 'Plenary session', - 'description': '', - 'duration': 45147, - 'thumbnail': 'https://storage.eup.glcloud.eu/thumbnail/default_thumbnail.png', 'release_timestamp': 1663139069, 'release_date': '20220914', - 'modified_timestamp': 1663650921, - 'modified_date': '20220920', - 'live_status': 'was_live', + }, + 'params': { + 'skip_download': True, }, }, { + # live webstream 'url': 'https://multimedia.europarl.europa.eu/en/webstreaming/euroscola_20221115-1000-SPECIAL-EUROSCOLA', - 'md5': '8b4304f9e15a6e133100248fb55a5dce', 'info_dict': { 'ext': 'mp4', - 'id': '20221115-1000-SPECIAL-EUROSCOLA', - 'release_timestamp': 1668502798, - 'title': 'Euroscola', + 'id': '510eda7f-ba72-161b-7ee7-0e836cd2e715', + 'release_timestamp': 1668502800, + 'title': 'Euroscola 2022-11-15 19:21', 'release_date': '20221115', - 'live_status': 'was_live', - 'description': '', - 'duration': 9587, - 'thumbnail': 'https://storage.eup.glcloud.eu/thumbnail/default_thumbnail.png', - 'modified_timestamp': 1668945274, - 'modified_date': '20221120', + 'live_status': 'is_live', }, + 'skip': 'not live anymore', }, { 'url': 'https://multimedia.europarl.europa.eu/en/webstreaming/committee-on-culture-and-education_20230301-1130-COMMITTEE-CULT', - 'md5': '0ca01cf33009d866e6f5e1cd3088c10c', 'info_dict': { - 'id': '20230301-1130-COMMITTEE-CULT', + 'id': '7355662c-8eac-445e-4bb9-08db14b0ddd7', + 'display_id': '20230301-1130-COMMITTEE-CULT', 'ext': 'mp4', 'release_date': '20230301', 'title': 'Committee on Culture and Education', 'release_timestamp': 1677666641, - 'description': 'Committee on Culture and Education', - 'duration': 1003, - 'thumbnail': 'https://storage.eup.glcloud.eu/thumbnail/default_thumbnail.png', - 'modified_timestamp': 1732475771, - 'modified_date': '20241124', - 'live_status': 'was_live', }, }, { + # live stream 'url': 'https://multimedia.europarl.europa.eu/en/webstreaming/committee-on-environment-public-health-and-food-safety_20230524-0900-COMMITTEE-ENVI', - 'md5': 'f2e8c30935f956a7165c2f4f4b4ee090', 'info_dict': { - 'id': '20230524-0900-COMMITTEE-ENVI', + 'id': 'e4255f56-10aa-4b3c-6530-08db56d5b0d9', 'ext': 'mp4', 'release_date': '20230524', - 'title': 'Committee on Environment, Public Health and Food Safety', - 'release_timestamp': 1684912288, - 'live_status': 'was_live', - 'description': 'Committee on Environment, Public Health and Food Safety', - 'duration': 4831, - 'thumbnail': 'https://storage.eup.glcloud.eu/thumbnail/default_thumbnail.png', - 'modified_timestamp': 1732475771, - 'modified_date': '20241124', + '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', }, { 'url': 'https://multimedia.europarl.europa.eu/en/webstreaming/20240320-1345-SPECIAL-PRESSER', - 'md5': '518758eb706471c4c4ef3a134034a5bd', 'info_dict': { - 'id': '20240320-1345-SPECIAL-PRESSER', + 'id': 'c1f11567-5b52-470a-f3e1-08dc3c216ace', + 'display_id': '20240320-1345-SPECIAL-PRESSER', 'ext': 'mp4', 'release_date': '20240320', 'title': 'md5:7c6c814cac55dea5e2d87bf8d3db2234', 'release_timestamp': 1710939767, - 'description': 'md5:7c6c814cac55dea5e2d87bf8d3db2234', - 'duration': 927, - 'thumbnail': 'https://storage.eup.glcloud.eu/thumbnail/default_thumbnail.png', - 'modified_timestamp': 1732475771, - 'modified_date': '20241124', - 'live_status': 'was_live', - }, - }, { - 'url': 'https://multimedia.europarl.europa.eu/en/webstreaming/20250328-1600-SPECIAL-PRESSER', - 'md5': 'dd1c5e67eb55e609998583d7c2966105', - 'info_dict': { - 'id': '20250328-1600-SPECIAL-PRESSER', - 'ext': 'mp4', - 'title': 'md5:04a2ab70c183dabe891a7cd190c3121d', - 'description': '', - 'duration': 1023, - 'thumbnail': 'https://storage.eup.glcloud.eu/thumbnail/default_thumbnail.png', - 'release_timestamp': 1743177199, - 'release_date': '20250328', - 'modified_timestamp': 1743180924, - 'modified_date': '20250328', - 'live_status': 'was_live', }, }, { 'url': 'https://multimedia.europarl.europa.eu/webstreaming/briefing-for-media-on-2024-european-elections_20240429-1000-SPECIAL-OTHER', @@ -202,41 +162,31 @@ class EuroParlWebstreamIE(InfoExtractor): }] def _real_extract(self, url): - video_id = self._match_id(url) - webpage = self._download_webpage(f'https://control.eup.glcloud.eu/content-manager/content-page/{video_id}', video_id) - stream_info = self._search_json(r'