From c29542327a520fd1efb43e9c4534a45b7d5256a6 Mon Sep 17 00:00:00 2001 From: Alexandre Ramos Date: Wed, 4 Jun 2025 00:26:17 +0100 Subject: [PATCH] [ie/educast] Address PR review comment Removed unnecessary parse_timestamp method Co-authored-by: Filipe Resendes --- yt_dlp/extractor/educast.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/yt_dlp/extractor/educast.py b/yt_dlp/extractor/educast.py index 3d185bbf3..f97d2c548 100644 --- a/yt_dlp/extractor/educast.py +++ b/yt_dlp/extractor/educast.py @@ -90,16 +90,6 @@ class EducastIE(EducastBaseIE): 'skip': 'This video is private and requires authentication to access', }] - def parse_timestamp(self, timestamp_str): - if isinstance(timestamp_str, str) and '.' in timestamp_str: - day, month, year_time = timestamp_str.split('.', 2) - year, time = year_time.split(' ', 1) - reformatted = f'{year}-{month}-{day} {time}' - timestamp = unified_timestamp(reformatted) - if timestamp is not None: - timestamp -= 3600 # Lisbon time (UTC+1) - return timestamp - def _extract_video_formats(self, video_json, video_id): formats = [] dash_url = traverse_obj(video_json, ('dash', 'url')) @@ -135,7 +125,7 @@ def _extract_from_json(self, video_id): 'alt_title': ('subtitle', {str}), 'description': ('clipDescription', {str}), 'uploader': ('author', {str}), - 'timestamp': ('timestamp', {self.parse_timestamp}), + 'timestamp': ('timestamp', {unified_timestamp}, {lambda x: x - 3600}), 'thumbnail': ('cover', {str}), 'license': ('licenceURL', {str}), 'webpage_url': ('url', {str}),