From e43409d40c4570be7d56ee8b434fd78ab0d1bea0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 18 Mar 2025 23:41:04 +0100 Subject: [PATCH] toml --- rwx/sw/ytdlp/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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):