skExtra - Metadata-Parser

:placard: Summary Apply and create metadata based on path and file name. High customization, read How to.txt to see how to set up.
:link: Repository https://github.com/shinekokunoichi/stash-plugins/tree/main/plugins/Extra/Metadata-Parser
:information_source: Source URL https://shinekokunoichi.github.io/stash-plugins/main/index.yml
:open_book: Install How to install a plugin?

Metadata-Parser

Apply and create metadata based on path and file name. High customization, read How to.txt to see how to set up.

  • Infinite rule for path exceptions
  • Auto create missing metadata
  • Simple and dynamic field (read How to.txt for details)
  • Support metadata parsing form path and filename

How to.txt

Available fields:

  General: Fields used for remove and match specific string part

    {i}         > Remove any matching words (not case sensitive) from "Ignored Words" setting
                  Ex:
                    Ignored - Image Actress
                    Parser  - {tag}{i}/{i}{performer}
                    Folder  - Sexy image/Hotty Actress
                    Parsed  - Tag: Sexy, Performer: Hotty

    {I}         > Remove any matching words (case sensitive) from "Ignored Words" settings
                  Ex:
                    Ignored - Image Actress
                    Parser  - {tag}{I}/{I}{performer}
                    Folder  - Sexy image/Hotty Actress
                    Parsed  - Tag: Sexy image, Performer: Hotty

    {d}         > Match any delimiter (.-_)
                  Ex:
                    Parser  - {index}{d}{group}{d}{title}{ext}
                    File    - 05_XXX_Video.mp4
                    Parsed  - Group: XXX, Scene Index: 05, Title: Video

    {ext}       > Remove the file extension (only for files and as last field)
                  Ex:
                    Parser  - {title}{ext}
                    File    - Hot.png
                    Parsed  - Title: Hot
    
  Metadata: Fields used for taking the metadata. You can't use two metadata fields without {d} between them.
            Ex: {title}{d}{studio}/{performer} is valid
                {title}{studio}/{performer} is not valid

    {title}     > Title (as is)

    {Title}     > Title (capitalize)

    {date}      > Date format from "Date Format" setting

    {yyyy}      > Four digit year

    {mm}        > One/Two digit month

    {dd}        > One/Two digit day

    {rating5}   > Based on rating with 5 stars

    {rating10}  > Based on rating with 10 stars

    {rating100} > Based on decimal rating

    {performer} > Performer

    {tag}       > Tag

    {gallery}   > Gallery (placeholder)

    {studio}    > Studio(if multiple studio fields are declared, will set the last one)
                  Ex:
                    Parser  - {studio}/{last:group}
                    Folder  - Studio A/Studio B/XXX
                    Parsed  - Studio: Studio B, Group: XXX

    {index}     > Scene group index

    {group}     > Group (if multiple group fields are declared, will set the last one)
                  Ex:
                    Parser  - {studio}/{group}/{last:performer}
                    Folder  - Studio A/XXX/ZZZ/Hotty
                    Parsed  - Studio: Studio A, Group: ZZZ, Performer: Hotty
  
  Combined: Add to other fields special effect

    {last:...}  > Set the last field until reach the last one
                  Ex:
                    Parser - {studio}/{group}/{last:index}
                    Path   - Studio A/XXX/ZZZ/YYY/HHH/03
                    Parsed - Studio: Studio A, Group: YYY, Scene Index: 03

    {&:...}     > Enable checking multiple value in one field based on "Multiple Delimiters" (only for {tag} and {performer})
                  Ex:
                    Multi  - and &
                    Parser - {studio}/{&:performer}
                    Path   - Studio A/Hotty and Sexy & Cuty
                    Parsed - Studio: Studio A, Performers: Hotty & Sexy & Cuty

Thanks for the plugin :slight_smile: is it intended for standalone use in the web UI or just through scripts? Right now I am using messy python with API calls to parse info but this plugin looks much nicer

1 Like

The plugin run directly in the web UI. Under plugins > settings you can set the general parser, under tasks you can find different options for parse your metadata. For path/file exceptions you need to set them under the file β€œRule.js” inside the plugin folder.

But in the next update i’ll replace everything with a easy GUI (you can check a small preview inside the discord server > plugins section)

1 Like