From 2a01ef0066b332f7165f298bfab8a907e67f5d48 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 23 Sep 2024 14:24:58 +0200 Subject: [PATCH] freetube.channels --- rwx/sw/freetube/channels.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 rwx/sw/freetube/channels.py 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}"\ +}}\ +"""