Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Help triggering post-processor after finished downloading a post #3117

Closed
shrublet opened this issue Oct 29, 2022 · 6 comments
Closed

Comments

@shrublet
Copy link

In short, I need to run an exec post-processor after the extractor has finished downloading all files from a post. Before, I was using the finalize event, and this worked alright as I was piping individual post urls through a text file. This method doesn't work though when inputting a profile url instead and having gallery-dl grab all the posts. The post event is almost what I need, but runs before files are downloaded instead of after which is what I'm looking for. I'm not sure if I'm missing something, but is this possible? There's a few workarounds I could probably do, but it would simplify the work immensely if there is an option like I'm describing. Help appreciated!

@Hrxn
Copy link
Contributor

Hrxn commented Oct 29, 2022

Well, it's either "event": "file" or "event": "after", whatever suits your needs..

@shrublet
Copy link
Author

Well, it's either "event": "file" or "event": "after", whatever suits your needs..

Hm.. okay. Neither really trigger when I need, but it seems there's no other option after combing through. Thought I may have missed something. I'll probably just have to recursively do stuff in a big script afterwards with finalize honestly, or I'll try to just have it check file count or something. Thanks!

@mikf
Copy link
Owner

mikf commented Oct 29, 2022

Currently there is no event that would trigger after a post, and implementing something like that isn't really feasible with the current code base.

Your best bet would be using "event": "after" with "filter": "num == count", i.e. check for after the last file in a post. Not all sites have num and count fields, though.

@shrublet
Copy link
Author

Your best bet would be using "event": "after" with "filter": "num == count", i.e. check for after the last file in a post. Not all sites have num and count fields, though.

I just saw that filtering postprocessors is possible, so I'll probably go this route. I'll have to do it on a per-site basis, but this should hopefully work on all the sites I need and way more manageable than having to mess around with walking directories. Thanks!

@mikf
Copy link
Owner

mikf commented Nov 2, 2022

I took another look at this and, as it turns out, adding a post-after event is much simpler than I initially thought in #3117 (comment), so I did just that: c12a97b.

@shrublet
Copy link
Author

shrublet commented Nov 3, 2022

Oh, great! Will wait for the next release version 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants