Skip to content

Add GroupAutoScraper plugin#682

Merged
DogmaDragon merged 8 commits intostashapp:mainfrom
Stash-KennyG:main
Mar 17, 2026
Merged

Add GroupAutoScraper plugin#682
DogmaDragon merged 8 commits intostashapp:mainfrom
Stash-KennyG:main

Conversation

@Stash-KennyG
Copy link
Contributor

@Stash-KennyG Stash-KennyG commented Mar 13, 2026

Summary

Adds GroupAutoScraper, an external (raw) plugin that automatically re-scrapes newly created groups when their first URL is an AdultDVD Empire link, then merges the scraped metadata back into the group.

What it does

  • Trigger: Group.Create.Post only (no update trigger).
  • URL filter: Only processes groups whose first URL contains adultdvdempire.com/. Others log an info message and exit without changes.
  • Flow: Calls scrapeGroupURL(url), then builds a GroupUpdate payload by merging scraped data with existing group data:
    • Prefers scraped values when present; otherwise keeps existing.
    • Uses scraped.studio.stored_id as studio_id only when not null; otherwise keeps existing studio or leaves unset.
    • Merges tag IDs: existing group tags + scraped tags with non-null stored_id, de-duplicated.
    • Sends front_image / back_image only when the scrape returns them (avoids overwriting with null).
  • Logging: Uses stashapi.log (via stashapp-tools) and prints a short summary on success (e.g. added tag count, whether studio was set or could not be resolved).

Files added

  • plugins/GroupAutoScraper/GroupAutoScraper.yml – plugin config and hook
  • plugins/GroupAutoScraper/autoScraper.py – main script (stashapi + requests)
    - plugins/GroupAutoScraper/manifest – plugin manifest
  • plugins/GroupAutoScraper/README.md – install and behavior docs
  • plugins/GroupAutoScraper/requirements.txt – Python dependencies

Requirements

  • Python 3.7+
  • stashapi and requests (same as other CommunityScripts Python plugins)
  • requests
  • stashapp-tools (provides the stashapi package used by the plugin)

Testing

  • Verified with Stash plugin UI: hook fires on group create.
  • Only AdultDVD Empire URLs are scraped; other URLs log and exit.
  • Success path logs summary with tag count and studio status.

…t Empire URLs to update tags and studio information. Includes main script, configuration files, and README documentation.
@Stash-KennyG
Copy link
Contributor Author

Group.Create.Post is a valid trigger. This validation rule appears to be out of date.

@DogmaDragon
Copy link
Contributor

Could you also create requirements.txt to make it easier for Docker users?

Documentation mentions only requests module as required, but it also imports from stashapi.

@DogmaDragon DogmaDragon added type:plugin Plugins object:group Affects or is triggered by group object labels Mar 15, 2026
KennyG added 6 commits March 16, 2026 10:29
…serving line breaks. Includes JavaScript and YAML configuration files.
Per DognaDragon it is created automatically.
- Added instructions for installing Python dependencies in the README.
- Included a new requirements.txt file listing necessary packages: requests and stashapp-tools.
- Updated README to clarify that the plugin works across environments with installed dependencies.
@Stash-KennyG
Copy link
Contributor Author

Stash-KennyG commented Mar 16, 2026

@DogmaDragon this should address outstanding issues.

@DogmaDragon DogmaDragon merged commit 2ff8501 into stashapp:main Mar 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

object:group Affects or is triggered by group object type:plugin Plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants