rssVideos: Make --research about downloading videos

This commit is contained in:
Geoffrey Frogeye 2021-12-26 15:06:40 +01:00
parent 84a2906be9
commit 7292e8ea88
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8

View file

@ -163,7 +163,7 @@ class RVElement:
return "ytdl_infos" in self.__dict__
def salvage_cache(self, cache: "RVElement") -> None:
if not self.parent.args.research and cache.is_researched:
if cache.is_researched:
self.__dict__["ytdl_infos"] = cache.__dict__["ytdl_infos"]
log.debug(f"From cache: {self}")
if cache.downloaded_filepath:
@ -233,6 +233,8 @@ class RVElement:
def download(self) -> None:
assert self.is_video
log.info(f"Downloading: {self}")
if self.parent.args.research:
del self.ytdl_infos
if not self.parent.args.dryrun:
with yt_dlp.YoutubeDL(self.parent.ytdl_opts) as ydl:
ydl.add_post_processor(SaveInfoPP(self))