Stash Tag Scraper

:placard: Summary A Python tool to fetch tag information from StashDB and transfer it directly to your local Stash instance.
:link: Repository https://github.com/thismanyboyfriends2/stash-tag-scraper

Features

Instead of manually syncing your tag descriptions, aliases, and categories between your local Stash instance and StashDB, this tool automatically fetches all that information and populates it for you.

  • Fast GraphQL-based fetching: Downloads ~3000 tags in seconds
  • Smart deduplication: Avoids creating duplicate tags
  • Alias management: Creates tag aliases while preventing conflicts
  • Category hierarchies: Creates parent-child relationships between tags and categories
  • Conflict logging: Saves skipped aliases to JSON for manual review

Installation & Running

The following instructions assume you are on a Linux / MacOS / WSL installation.

  1. Clone the repository:
git clone https://github.com/thismanyboyfriends2/stash-tag-scraper.git
cd stash-tag-scraper
  1. Install dependencies:
pip install -r requirements.txt
  1. Set your StashDB API key:
export STASHDB_API_KEY="your-api-key-here"

Alternatively, create a .env file (see .env.example).

  1. Then simply run the script:
python ./src/main.py
2 Likes

Hugely interested in this. But the github seems to be 404, is private or have you removed it?

2 Likes

unfortunately the admin team at GitHub decided in their infinite wisdom to suspend my account because of a breach in the TOS. Probably because I was writing adult RELATED stuff - they haven’t explained it. I was waiting for them to reinstate it but I might put up a dummy account in the meantime - I have some other contributions to plugins and scrapers that are pending my account reactivation.

alright. we’re back up. I’ve uploaded it to another account and carefully reviewed it so I don’t fall afoul of the TOS. The original post is amended with the new location.

1 Like

Released a new version: v0.2. This will also correctly sync up all tags and existing tags with their StashDB UUIDs.

Really glad the new stash supports matching tags by StashBox ID now - the previous version of this tool merely had it as a link in the details.

This has now been deprecated in favour of a plugin. It should be easier to install and get working. More info here: