Path: blob/master/gallery_dl/postprocessor/directory.py
8753 views
# -*- coding: utf-8 -*-12# Copyright 2025 Mike Fährmann3#4# This program is free software; you can redistribute it and/or modify5# it under the terms of the GNU General Public License version 2 as6# published by the Free Software Foundation.78"""Trigger directory format string evaluation"""910from .common import PostProcessor111213class DirectoryPP(PostProcessor):1415def __init__(self, job, options):16PostProcessor.__init__(self, job)1718events = options.get("event")19if events is None:20events = ("prepare",)21elif isinstance(events, str):22events = events.split(",")23job.register_hooks({event: self.run for event in events}, options)2425def run(self, pathfmt):26pathfmt.set_directory(pathfmt.kwdict)272829__postprocessor__ = DirectoryPP303132