This commit is contained in:
Marc Beninca 2025-03-18 18:29:48 +01:00
parent cc4eb0e686
commit 3e04daeb8b
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -85,6 +85,11 @@ class Video(Object):
:type d: dict
"""
self.at = datetime.now().strftime("%Y%m%d%H%M%S")
# title
# description truncated
# duration
# thumbnails
# view_count
self.uid = d["id"]
self.fulltitle = d["fulltitle"]
self.duration = d["duration"]
@ -93,22 +98,6 @@ class Video(Object):
self.description = d["description"]
# channel
# title
# channel_follower_count
# description
# tags
# thumbnails
# uploader_id
# uploader
# videos / entries
# title
# description truncated
# duration
# thumbnails
# view_count
# ╭──────────╮
# │ download │
# ╰──────────╯
@ -197,33 +186,6 @@ def extract_videos(channel_id: str) -> dict:
return extract(url_videos(channel_id))
# ╭────────╮
# │ filter │
# ╰────────╯
def filter_video(d: dict) -> dict:
"""Return filtered video dict.
:param d: video info dict
:type d: dict
:rtype: dict
"""
return {
"title": d["title"],
}
def filter_videos(d: dict) -> list[str]:
"""Return filtered videos dict.
:param d: videos dict
:type d: dict
:rtype: dict
"""
return [entry["id"] for entry in reversed(d["entries"])]
# ╭──────╮
# │ next │
# ╰──────╯