clean exit

This commit is contained in:
Danilo Reyes
2026-03-02 22:29:04 -06:00
parent ba42689aa9
commit e985e359a7
2 changed files with 8 additions and 0 deletions

View File

@@ -62,6 +62,11 @@ class User:
for lst in filter(lambda x: not self.lists[x].is_file(), ["master", "push"]):
self.lists[lst].touch()
for lst in filter(
lambda x: not self.lists[x].is_file(),
["instagram", "kemono", "main"],
):
self.lists[lst].touch()
def append_list(self, name: str, line: str) -> None:
"""Appends a line into the given list"""

View File

@@ -74,6 +74,9 @@ def parse_gallery(gdl_list: str, user: User) -> None:
"""Processes the gallery-dl command based on the selected gallery"""
args = get_args()
list_path = user.lists[gdl_list]
if not list_path.is_file():
LOG.warning("List file missing: %s", list_path)
return
with open(list_path, "r", encoding="utf-8") as r_file:
links = list(map(lambda x: x.rstrip(), r_file))
for link in filter(None, links):