From 2fb35f6004c7625f0dd493da4a5abf0690f7777c Mon Sep 17 00:00:00 2001 From: coletdjnz Date: Sat, 3 Jun 2023 18:33:51 +1200 Subject: [PATCH] [extractor/youtube] Support shorter relative time format (#7191) See: https://github.com/TeamNewPipe/NewPipeExtractor/issues/1067 Authored by: coletdjnz --- yt_dlp/extractor/youtube.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index ccf97705a1..6e7485c030 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -893,9 +893,16 @@ def _extract_thumbnails(data, *path_list): def extract_relative_time(relative_time_text): """ Extracts a relative time from string and converts to dt object - e.g. 'streamed 6 days ago', '5 seconds ago (edited)', 'updated today' + e.g. 'streamed 6 days ago', '5 seconds ago (edited)', 'updated today', '8 yr ago' """ - mobj = re.search(r'(?Ptoday|yesterday|now)|(?P