Python Scripts: update gallery-dl wrapper
This commit is contained in:
parent
f24c306257
commit
0b507ae747
1 changed files with 10 additions and 3 deletions
|
@ -16,7 +16,7 @@ DATETIME = datetime.now().strftime("%F_%H-%M-%S")
|
|||
|
||||
|
||||
# Handle Ctrl-C
|
||||
def handle_sigint(signal_received, frame):
|
||||
def handle_sigint(signal_received, _frame):
|
||||
print("\nProcess interrupted. Cleaning up...")
|
||||
sys.exit(1)
|
||||
|
||||
|
@ -64,7 +64,13 @@ def generate_site_name_from_url(url):
|
|||
# Function to execute gallery-dl command
|
||||
def execute_gallery_dl(input_source, log_file, sitename, workdir, extra_args=None):
|
||||
if check_lock(sitename, workdir):
|
||||
log_path = os.path.join(workdir, "logs", sitename, f"{log_file}-{DATETIME}.log")
|
||||
log_path = os.path.join(
|
||||
workdir,
|
||||
"logs",
|
||||
sitename,
|
||||
f"{
|
||||
log_file}-{DATETIME}.log",
|
||||
)
|
||||
command = [
|
||||
"/home/aroy/.local/bin/gallery-dl",
|
||||
"-c",
|
||||
|
@ -134,7 +140,8 @@ if __name__ == "__main__":
|
|||
sitename = input_source.lower().split("-")[-1].split(".")[0]
|
||||
else:
|
||||
print(
|
||||
f"Error: Input '{input_source}' is not a valid URL, file, or predefined source."
|
||||
f"Error: Input '{
|
||||
input_source}' is not a valid URL, file, or predefined source."
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue