diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index 5f3ebfa8..8be1ac17 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -59,5 +59,11 @@ "date-max": 253402210800, "recursion": 0 } + }, + "output": + { + "mode": "auto", + "shorten": true, + "progress": true } } diff --git a/gallery_dl/__init__.py b/gallery_dl/__init__.py index 7cf2e0c2..dfd3330f 100644 --- a/gallery_dl/__init__.py +++ b/gallery_dl/__init__.py @@ -41,6 +41,15 @@ def initialize_logging(): root.addHandler(handler) +def progress(urls, pformat): + if pformat is True: + pformat = "[{current}/{total}] {url}" + pinfo = {"total": len(urls)} + for pinfo["current"], pinfo["url"] in enumerate(urls, 1): + print(pformat.format_map(pinfo), file=sys.stderr) + yield pinfo["url"] + + def sanatize_input(file): for line in file: line = line.strip() @@ -98,8 +107,7 @@ def main(): file = sys.stdin else: file = open(args.inputfile) - import itertools - urls = itertools.chain(urls, sanatize_input(file)) + urls += sanatize_input(file) except OSError as exc: log.warning("input-file: %s", exc) @@ -109,6 +117,10 @@ def main(): except OSError as exc: log.warning("unsupported-URL file: %s", exc) + pformat = config.get(("output", "progress"), True) + if pformat and len(urls) > 1 and args.loglevel < logging.ERROR: + urls = progress(urls, pformat) + for url in urls: try: log.debug("Starting %s for '%s'", jobtype.__name__, url) diff --git a/gallery_dl/extractor/pawoo.py b/gallery_dl/extractor/pawoo.py index aba968c6..b464c7c6 100644 --- a/gallery_dl/extractor/pawoo.py +++ b/gallery_dl/extractor/pawoo.py @@ -57,7 +57,7 @@ class PawooAccountExtractor(PawooExtractor): test = [ ("https://pawoo.net/@kuroda", { "url": "a3f9e7555f2b024554c0e9b6cbcc7991af13cf99", - "keyword": "81e084503755d564ef15ef0db88ae1d9cf89f258", + "keyword": "1b4e0dc5ac6c22ce9485ba12ecc200d0aaa2ffae", }), ("https://pawoo.net/@zZzZz/", { "exception": exception.NotFoundError, @@ -85,7 +85,7 @@ class PawooStatusExtractor(PawooExtractor): test = [ ("https://pawoo.net/@takehana_note/559043", { "url": "f95cc8c0274c4143e7e21dbdc693b90c65b596e3", - "keyword": "590105849b0435e17ca65258b9150cd0502d24da", + "keyword": "7d060d9c4572b381aa423797ad48d89a12daac77", "content": "3b148cf90174173355fe34179741ce476921b2fc", }), ("https://pawoo.net/@zZzZz/12346", {