diff --git a/rwx/sw/freetube/channels.py b/rwx/sw/freetube/channels.py new file mode 100644 index 0000000..48f6d05 --- /dev/null +++ b/rwx/sw/freetube/channels.py @@ -0,0 +1,29 @@ +"""FreeTube channels.""" + +from rwx import Class + + +class Channel(Class): + """FreeTube channel.""" + + def __init__(self, uid: str, name: str) -> None: + """Set uid & name. + + :param uid: unique identifier + :type uid: str + :param name: label + :type name: str + """ + self.id = uid + self.name = name + + def to_db(self) -> str: + """Return identifier as db. + + :rtype: str + """ + return f"""\ +{{\ +"id":"{self.id}"\ +}}\ +"""