From 78ac757ef2a0343d0792c5ebbeb59b16daacebe7 Mon Sep 17 00:00:00 2001 From: Wilbur Jaywright Date: Thu, 18 Apr 2024 08:23:10 -0400 Subject: [PATCH] Added .localvars (completed #2) - Moved some absolute variables to a .localvares submodule - Added API_TYPE_ variables to .localvars - Added STREAM_VIS_ variables to .localvars --- src/cocorum/localvars.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/cocorum/localvars.py diff --git a/src/cocorum/localvars.py b/src/cocorum/localvars.py new file mode 100644 index 0000000..314706e --- /dev/null +++ b/src/cocorum/localvars.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +#Cocorum local variable definitions +#S.D.G. + +TIMESTAMP_FORMAT = "%Y-%m-%dT%H:%M:%S" #Rumble timestamp format, not including the 6 TODO characters at the end + +HEADERS = {"User-Agent" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"} + +STATIC_KEYS = [ #Keys of the API JSON that should not change unless the API URL changes, and so do not trigger a refresh + "user_id", + "username", + "channel_id", + "channel_name", + ] + +STATIC_KEYS_STREAM = [ #Keys of the API JSON stream object that should not change unless the API URL changes, and so do not trigger a refresh + "id", + "created_on" + ] + +#API types, under JSON["type"] +API_TYPE_USER = "user" +API_TYPE_CHANNEL = "channel" + +#Stream visibility possibilities, under JSON["livestreams"][0]["visibility"] +STREAM_VIS_PUBLIC = "public" +STREAM_VIS_UNLISTED = "unlisted" +STREAM_VIS_PRIVATE = "private"