Make rssVideos use release date

This commit is contained in:
Geoffrey Frogeye 2022-11-04 14:07:37 +01:00
parent 95faa0c0ff
commit ceaa2d1671
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8

View file

@ -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