useless
This commit is contained in:
parent
e81cd5b745
commit
cc4eb0e686
1 changed files with 11 additions and 6 deletions
|
@ -12,6 +12,11 @@ from rwx.log import stream as log
|
||||||
URL = "https://youtube.com"
|
URL = "https://youtube.com"
|
||||||
|
|
||||||
|
|
||||||
|
# ╭─────────╮
|
||||||
|
# │ classes │
|
||||||
|
# ╰─────────╯
|
||||||
|
|
||||||
|
|
||||||
class Cache(Object):
|
class Cache(Object):
|
||||||
"""YouTube local cache."""
|
"""YouTube local cache."""
|
||||||
|
|
||||||
|
@ -79,7 +84,7 @@ class Video(Object):
|
||||||
:param d: video info
|
:param d: video info
|
||||||
:type d: dict
|
: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.uid = d["id"]
|
||||||
self.fulltitle = d["fulltitle"]
|
self.fulltitle = d["fulltitle"]
|
||||||
self.duration = d["duration"]
|
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.
|
"""Return extracted dict.
|
||||||
|
|
||||||
:rtype: dict
|
:rtype: dict
|
||||||
|
@ -159,7 +164,7 @@ def extract_playlist(playlist_id: str) -> dict:
|
||||||
:type playlist_id: str
|
:type playlist_id: str
|
||||||
:rtype: dict
|
:rtype: dict
|
||||||
"""
|
"""
|
||||||
return extract({}, url_playlist(playlist_id))
|
return extract(url_playlist(playlist_id))
|
||||||
|
|
||||||
|
|
||||||
def extract_playlists(channel_id: str) -> dict:
|
def extract_playlists(channel_id: str) -> dict:
|
||||||
|
@ -169,7 +174,7 @@ def extract_playlists(channel_id: str) -> dict:
|
||||||
:type channel_id: str
|
:type channel_id: str
|
||||||
:rtype: dict
|
:rtype: dict
|
||||||
"""
|
"""
|
||||||
return extract({}, url_playlists(channel_id))
|
return extract(url_playlists(channel_id))
|
||||||
|
|
||||||
|
|
||||||
def extract_video(video_id: str) -> dict:
|
def extract_video(video_id: str) -> dict:
|
||||||
|
@ -179,7 +184,7 @@ def extract_video(video_id: str) -> dict:
|
||||||
:type video_id: str
|
:type video_id: str
|
||||||
:rtype: dict
|
:rtype: dict
|
||||||
"""
|
"""
|
||||||
return extract({}, url_video(video_id))
|
return extract(url_video(video_id))
|
||||||
|
|
||||||
|
|
||||||
def extract_videos(channel_id: str) -> dict:
|
def extract_videos(channel_id: str) -> dict:
|
||||||
|
@ -189,7 +194,7 @@ def extract_videos(channel_id: str) -> dict:
|
||||||
:type channel_id: str
|
:type channel_id: str
|
||||||
:rtype: dict
|
:rtype: dict
|
||||||
"""
|
"""
|
||||||
return extract({}, url_videos(channel_id))
|
return extract(url_videos(channel_id))
|
||||||
|
|
||||||
|
|
||||||
# ╭────────╮
|
# ╭────────╮
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue