From ceaa2d1671ec036e2f56dcf3cba1b966c5fc3c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 4 Nov 2022 14:07:37 +0100 Subject: [PATCH] Make rssVideos use release date --- config/scripts/rssVideos | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config/scripts/rssVideos b/config/scripts/rssVideos index c95866f..2219d55 100755 --- a/config/scripts/rssVideos +++ b/config/scripts/rssVideos @@ -148,7 +148,12 @@ class RVElement: @property def date(self) -> datetime.datetime: - return datetime.datetime.fromtimestamp(self.item["published"]) + timestamp = ( + int(self.item.get("timestampUsec", "0")) / 1000000 + or int(self.item.get("crawlTimeMsec", "0")) / 1000 + or self.item["published"] + ) + return datetime.datetime.fromtimestamp(timestamp) @property def is_researched(self) -> bool: @@ -475,7 +480,7 @@ class RVDatabase: def ytdl_opts(self) -> dict: # Get user/system options prev_argv = sys.argv - sys.argv = ['yt-dlp'] + sys.argv = ["yt-dlp"] _, _, _, ydl_opts = yt_dlp.parse_options() sys.argv = prev_argv return ydl_opts