mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-11-13 13:05:13 +00:00
[ie/youtube:tab] Fix approximate timestamp extraction for feeds (#14539)
Authored by: coletdjnz
This commit is contained in:
@@ -1196,7 +1196,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
||||
except ValueError:
|
||||
return None
|
||||
|
||||
def _parse_time_text(self, text):
|
||||
def _parse_time_text(self, text, report_failure=True):
|
||||
if not text:
|
||||
return
|
||||
dt_ = self.extract_relative_time(text)
|
||||
@@ -1211,7 +1211,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
||||
(r'([a-z]+\s*\d{1,2},?\s*20\d{2})', r'(?:.+|^)(?:live|premieres|ed|ing)(?:\s*(?:on|for))?\s*(.+\d)'),
|
||||
text.lower(), 'time text', default=None)))
|
||||
|
||||
if text and timestamp is None and self._preferred_lang in (None, 'en'):
|
||||
if report_failure and text and timestamp is None and self._preferred_lang in (None, 'en'):
|
||||
self.report_warning(
|
||||
f'Cannot parse localized time text "{text}"', only_once=True)
|
||||
return timestamp
|
||||
|
||||
Reference in New Issue
Block a user