freetube.videos

This commit is contained in:
Marc Beninca 2024-09-23 14:35:32 +02:00
parent 6ece695be4
commit 46ec104b75
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

33
rwx/sw/freetube/videos.py Normal file
View file

@ -0,0 +1,33 @@
"""FreeTube videos."""
from rwx import Class
class Video(Class):
"""FreeTube video."""
def __init__(self, uid: str, name: str) -> None:
"""Set id & name.
:param uid: identifier
:type uid: str
:param name: label
:type name: str
"""
self.uid = uid
self.name = name
def to_db(self) -> str:
"""Return identifier, zero length & title.
:rtype: str
"""
return f"""\
{{\
"videoId":"{self.uid}"\
,\
"lengthSeconds":0\
,\
"title":"{self.name}"\
}}\
"""