Post-Processing
Post-processing scripts run after Scryer places a file in its library. Use them for anything Scryer does not do itself: tagging, transcoding, remote sync, or custom notifications.
- To access: Settings → Post-processing
- To view: Requires
manageCatalogSettingsapp permission
Defining A Script
Section titled “Defining A Script”Each script has:
- Script type:
inlineshell content stored in Scryer, orfilepointing at a script on disk. Inline shell requires an explicit acknowledgement because it runs with Scryer’s privileges. - Applied facets: which of Movies, Series, and Anime trigger it.
- Execution mode:
blockingwaits for the script before the import is marked complete;fire_and_forgetstarts it and moves on. - Timeout: seconds before Scryer kills the process tree. Blocking scripts that time out are recorded as such.
- Priority: order when several scripts apply to one import.
- Enabled and Debug: debug keeps stdout and stderr tails on the run record.
What The Script Receives
Section titled “What The Script Receives”Scryer sets these environment variables for every run:
| Variable | Contents |
|---|---|
SCRYER_EVENT | Always post_import |
SCRYER_FILE_PATH | Final path of the imported file |
SCRYER_FACET | movie, series, or anime |
SCRYER_TITLE_ID | Scryer’s title identifier |
SCRYER_TITLE_NAME | Title name |
SCRYER_METADATA | JSON with the full context: year, IMDb and TVDB ids, season, episode, quality, and more |
The working directory is the imported file’s directory. Parse SCRYER_METADATA for anything not exposed as its own variable.
Run Records
Section titled “Run Records”Every execution is stored with status (success, failed, timeout), exit code, duration, the environment payload, and, with debug on, output tails. Read them from the Post-processing page when a script misbehaves before changing the script itself.
Practical Notes
Section titled “Practical Notes”- Keep scripts idempotent. Upgrades and manual re-imports run them again for the same title.
- Prefer
fire_and_forgetfor slow work such as transcodes so imports do not queue behind it. - If you rename with the recycle bin enabled, scripts see the final path, not the recycled one.
- Rename templates run before scripts, so change templates first and re-check one import.
Related
Section titled “Related”- Media Servers covers library refreshes, which do not need a script.
- Import explains the step that precedes post-processing.