All checks were successful
/ job (push) Successful in 1m12s
new development branch from root commit
33 lines
560 B
Python
33 lines
560 B
Python
"""FreeTube videos."""
|
|
|
|
from rwx import Object
|
|
|
|
|
|
class Video(Object):
|
|
"""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}"\
|
|
}}\
|
|
"""
|