From 8219a78b8d610edf90c0f42616fe41017f8d2488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 29 Jun 2024 23:50:52 +0200 Subject: [PATCH] [actions] extend 'wait' allow specifying a duration like for --sleep --- gallery_dl/actions.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gallery_dl/actions.py b/gallery_dl/actions.py index 1d18e3a3..6b682b72 100644 --- a/gallery_dl/actions.py +++ b/gallery_dl/actions.py @@ -9,6 +9,7 @@ """ """ import re +import time import logging import operator from . import util, exception @@ -87,8 +88,15 @@ def action_exec(opts): def action_wait(opts): - def _wait(args): - input("Press Enter to continue") + if opts: + seconds = util.build_duration_func(opts) + + def _wait(args): + time.sleep(seconds()) + else: + def _wait(args): + input("Press Enter to continue") + return _wait