Compare commits
2 Commits
5ad8fc0dc8
...
c71ff53b23
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c71ff53b23 | ||
|
|
83210d4356 |
@@ -61,9 +61,12 @@ class Gallery:
|
|||||||
for key, env_var in auth_env.items():
|
for key, env_var in auth_env.items():
|
||||||
command += ["-o", f"{key}={os.environ.get(env_var, '')}"]
|
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)
|
command.append(self.link)
|
||||||
if self.list and not self.link:
|
elif self.link:
|
||||||
|
command.append(self.link)
|
||||||
|
elif self.list:
|
||||||
command += ["-i", queue]
|
command += ["-i", queue]
|
||||||
|
|
||||||
LOG.debug(command)
|
LOG.debug(command)
|
||||||
|
|||||||
@@ -23,8 +23,17 @@ from classes.user import User
|
|||||||
from classes.gallery import Gallery
|
from classes.gallery import Gallery
|
||||||
|
|
||||||
# GLOBAL VARIABLE SECTION
|
# GLOBAL VARIABLE SECTION
|
||||||
CONFIGS = load_config_variables()
|
CONFIGS = None
|
||||||
# Enable a default "everyone" flag for when running stuff like download gallery
|
# 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"]]
|
USERS = ["everyone"] + [user["name"] for user in CONFIGS["users"]]
|
||||||
ARGS = argparser(USERS)
|
ARGS = argparser(USERS)
|
||||||
|
|
||||||
@@ -304,6 +313,7 @@ def scrap_everyone() -> None:
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main module to decide what to do based on the parsed arguments"""
|
"""Main module to decide what to do based on the parsed arguments"""
|
||||||
|
init_globals()
|
||||||
if ARGS.scrapper:
|
if ARGS.scrapper:
|
||||||
rgx_shared = re.compile("push|main|instagram|kemono")
|
rgx_shared = re.compile("push|main|instagram|kemono")
|
||||||
if (ARGS.user in "everyone") and (rgx_shared.search(ARGS.scrapper)):
|
if (ARGS.user in "everyone") and (rgx_shared.search(ARGS.scrapper)):
|
||||||
|
|||||||
Reference in New Issue
Block a user