Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/bulkImageScrape/BulkImageScrape.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bulk Image Scrape
description: Apply an image scraper to all images
version: 0.1
version: 0.2
url: https://github.com/stashapp/CommunityScripts/
exec:
- python
Expand Down
41 changes: 41 additions & 0 deletions plugins/bulkImageScrape/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Bulk Image Scraper

Apply any image scraper to all of your images

## Install

After you installed the plugin, make sure you have the latest version of stashapi installed by running `pip install -r <path to your stash>/plugins/community/bulkImageScraper/requirements.txt`

## Config

Go into your Stash then under `Settings > Plugins` you'll find the config for Bulk Image Scrape

It is mandatory to enter the Scraper ID (the Name) of the Scraper you want to use. In this example [SHALookup](https://github.com/FansDB/metadata-scrapers) is used but you can use any Scraper that is installed in your Stash and is valid for image scraping.

![Settings](./res/settings.png)

- `Create Missing movies/groups from scrape result`
> if the scraper returns a movie/group and it is not already in your stash, the plugin will create it if enabled
- `Create Missing performer from scrape result`
> if the scraper returns a performer and it is not already in your stash, the plugin will create it if enabled
- `Create Missing studios from scrape result`
> if the scraper returns a studio and it is not already in your stash, the plugin will create it if enabled
- `Exclude images that are set as organized`
> Any image that is set as organized will be skipped if enabled
- `Merge existingtags with scraped tags`
> merge scraped tags with existing tags instead of overwriting them when enabled
- `The Scraper ID of the image scraper to use`
> Enter the ID/Name of the scraper you want to use here. If this is not set correctly the plugin will tell you in the logs when you run the plugin task
- `List of tags to skip`
> Any image that has one or more of the Tags from this setting will be skipped by the plugin if Tags are specified here. Multiple Tags must be comma separated. If the plugin can't find a tag you specified it will notify you in the logs

## Task

After you adapted the config to your liking and made sure your image scraper of choice works properly simply start the task in `Settings > Tasks`

![Task](./res/task.png)

Once the Task is running you can track the progress in `Settings > Log`
If the plugin encounters any issues you will be informed here

![Running](./res/running.png)
4 changes: 2 additions & 2 deletions plugins/bulkImageScrape/bulkImageScrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ def update_image(client: StashInterface, update: dict) -> dict | None:
scrape: dict | list[dict] | None = scrape_image(stash, image["id"], scraper_id)
valid: bool = scrape_is_valid(scrape)
if not valid:
log.error(
f"Scraper returned invalid result for image {image['id']} with scraper {scraper_id}"
log.debug(
f"Scraper returned invalid/empty result for image {image['id']} with scraper {scraper_id} - skipping"
)
continue

Expand Down
Binary file added plugins/bulkImageScrape/res/running.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plugins/bulkImageScrape/res/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plugins/bulkImageScrape/res/task.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.