diff --git a/rwx/sw/ytdlp/__init__.py b/rwx/sw/ytdlp/__init__.py index a89171a..69a5ede 100644 --- a/rwx/sw/ytdlp/__init__.py +++ b/rwx/sw/ytdlp/__init__.py @@ -7,6 +7,7 @@ from typing import Any from yt_dlp import YoutubeDL from rwx import Object +from rwx.fs import read_file_dict from rwx.log import stream as log TIMESTAMP = "%Y%m%d%H%M%S" @@ -21,8 +22,14 @@ URL = "https://youtube.com" class Cache(Object): """YouTube local cache.""" - def __init__(self, root: Path) -> None: - self.root = root + def __init__(self, root_file: Path) -> None: + self.root_file = root_file.resolve() + self.root_directory = self.root_file.parent + self.load() + + def load(self) -> None: + d = read_file_dict(self.root_file) + log.info(d) class Channel(Object):