diff --git a/rwx/sw/ytdlp/__init__.py b/rwx/sw/ytdlp/__init__.py index c6bae2b..326d5b1 100644 --- a/rwx/sw/ytdlp/__init__.py +++ b/rwx/sw/ytdlp/__init__.py @@ -12,6 +12,11 @@ from rwx.log import stream as log URL = "https://youtube.com" +# ╭─────────╮ +# │ classes │ +# ╰─────────╯ + + class Cache(Object): """YouTube local cache.""" @@ -79,7 +84,7 @@ class Video(Object): :param d: video info :type d: dict """ - self.datetime = datetime.now().strftime("%Y%m%d%H%M%S") + self.at = datetime.now().strftime("%Y%m%d%H%M%S") self.uid = d["id"] self.fulltitle = d["fulltitle"] self.duration = d["duration"] @@ -136,7 +141,7 @@ def download_video(video_id: str | None) -> None: # ╰─────────╯ -def extract(opt: dict[str, Any], url: str) -> dict[str, Any]: +def extract(url: str) -> dict[str, Any]: """Return extracted dict. :rtype: dict @@ -159,7 +164,7 @@ def extract_playlist(playlist_id: str) -> dict: :type playlist_id: str :rtype: dict """ - return extract({}, url_playlist(playlist_id)) + return extract(url_playlist(playlist_id)) def extract_playlists(channel_id: str) -> dict: @@ -169,7 +174,7 @@ def extract_playlists(channel_id: str) -> dict: :type channel_id: str :rtype: dict """ - return extract({}, url_playlists(channel_id)) + return extract(url_playlists(channel_id)) def extract_video(video_id: str) -> dict: @@ -179,7 +184,7 @@ def extract_video(video_id: str) -> dict: :type video_id: str :rtype: dict """ - return extract({}, url_video(video_id)) + return extract(url_video(video_id)) def extract_videos(channel_id: str) -> dict: @@ -189,7 +194,7 @@ def extract_videos(channel_id: str) -> dict: :type channel_id: str :rtype: dict """ - return extract({}, url_videos(channel_id)) + return extract(url_videos(channel_id)) # ╭────────╮