Compare commits

..

2 Commits

Author SHA1 Message Date
Danilo Reyes
c71ff53b23 init variable order, so that tests can be built. 2026-02-28 19:48:49 -06:00
Danilo Reyes
83210d4356 check if both list and link are provided 2026-02-28 19:42:27 -06:00
2 changed files with 18 additions and 5 deletions

View File

@@ -61,9 +61,12 @@ class Gallery:
for key, env_var in auth_env.items():
command += ["-o", f"{key}={os.environ.get(env_var, '')}"]
if self.link and not self.list:
if self.link and self.list:
LOG.warning("Both link and list set; using link and ignoring list.")
command.append(self.link)
if self.list and not self.link:
elif self.link:
command.append(self.link)
elif self.list:
command += ["-i", queue]
LOG.debug(command)

View File

@@ -23,8 +23,17 @@ from classes.user import User
from classes.gallery import Gallery
# GLOBAL VARIABLE SECTION
CONFIGS = load_config_variables()
CONFIGS = None
# Enable a default "everyone" flag for when running stuff like download gallery
USERS = []
ARGS = None
def init_globals() -> None:
"""Initialize global config and CLI args."""
global CONFIGS, USERS, ARGS
if CONFIGS is None:
CONFIGS = load_config_variables()
USERS = ["everyone"] + [user["name"] for user in CONFIGS["users"]]
ARGS = argparser(USERS)
@@ -304,6 +313,7 @@ def scrap_everyone() -> None:
def main():
"""Main module to decide what to do based on the parsed arguments"""
init_globals()
if ARGS.scrapper:
rgx_shared = re.compile("push|main|instagram|kemono")
if (ARGS.user in "everyone") and (rgx_shared.search(ARGS.scrapper)):