reluce / szurubooru-toolkit

Python package and script collection to manage your szurubooru image board.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't delete video posts

Telkhine opened this issue · comments

commented

I'm unable to use the delete-posts tool to delete video posts. In szurubooru.py, in the get_posts method, which delete-posts uses, videos are excluded from the results:

try:
# Ignore mp4 and webms
query_params = {'query': f'type:image,animation {query}'}
query_url = self.szuru_api_url + '/posts/?' + urllib.parse.urlencode(query_params)
logger.debug(f'Getting post from query_url: {query_url}')

Is there a reason videos are explicitly excluded? Could we have an option to include them?

Thanks

commented

Looking at an old commit 0f14b1f, it appears this method was only meant for tagging posts at the time? delete-posts.py didn't exist yet.

Yes, excluding videos was only meant for the auto tagger, as SauceNao doesn't support video files.
I've removed that limitation for the scripts reset-posts, delete-posts and tag-posts.

Can you go ahead and test if it works for you? (The fix is only available on the GitHub repo for now)

commented

Thanks for the assist. This looks to be in working order. 🍻