rssVideos: Make --research about downloading videos
This commit is contained in:
parent
84a2906be9
commit
7292e8ea88
|
@ -163,7 +163,7 @@ class RVElement:
|
||||||
return "ytdl_infos" in self.__dict__
|
return "ytdl_infos" in self.__dict__
|
||||||
|
|
||||||
def salvage_cache(self, cache: "RVElement") -> None:
|
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"]
|
self.__dict__["ytdl_infos"] = cache.__dict__["ytdl_infos"]
|
||||||
log.debug(f"From cache: {self}")
|
log.debug(f"From cache: {self}")
|
||||||
if cache.downloaded_filepath:
|
if cache.downloaded_filepath:
|
||||||
|
@ -233,6 +233,8 @@ class RVElement:
|
||||||
def download(self) -> None:
|
def download(self) -> None:
|
||||||
assert self.is_video
|
assert self.is_video
|
||||||
log.info(f"Downloading: {self}")
|
log.info(f"Downloading: {self}")
|
||||||
|
if self.parent.args.research:
|
||||||
|
del self.ytdl_infos
|
||||||
if not self.parent.args.dryrun:
|
if not self.parent.args.dryrun:
|
||||||
with yt_dlp.YoutubeDL(self.parent.ytdl_opts) as ydl:
|
with yt_dlp.YoutubeDL(self.parent.ytdl_opts) as ydl:
|
||||||
ydl.add_post_processor(SaveInfoPP(self))
|
ydl.add_post_processor(SaveInfoPP(self))
|
||||||
|
|
Loading…
Reference in a new issue