1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-06-23 14:09:39 +02:00

Add custom script wiki

vertigo235 2017-01-23 15:27:38 -05:00
parent 5b08a786d2
commit 03c64cca05

@ -0,0 +1,55 @@
If you're looking to trigger a custom script in your download client to tell Radarr when to update, you can find more details here. Scripts are added to Radarr via the *Connect* Settings page.
### Overview ###
Radarr can execute a custom script when new episodes are imported or a series is renamed, depending on the which action occurred the parameters will be different. Parameters are passed to the script through environment variables (allowing for more flexibility in what we send to the script and not having to worry about a particular order). In all cases the Environment Variables Radarr sends will be prefixed with `Radarr` and converted to lowercase, the `Series_Id` will appear as `Radarr_series_id`.
### Environment Variables ###
##### On Grab #####
| Environment Variable | Details |
|---|---|
| EventType | Grab|
| Movie_Id | Internal ID of the movie|
| Movie_Title| Title of the movie|
| Movie_ImdbId| imdb id for the series |
| Release_Title | NZB/Torrent title |
| Release_Indexer | Indexer where the release was grabbed |
| Release_Size | Size of the release reported by the indexer |
| Release_ReleaseGroup | Release Group, will not be set if it is unknown |
##### On Download/On Upgrade #####
| Environment Variable | Details |
|---|---|
| EventType | Download |
| Movie_Id | Internal ID of the movie |
| Movie_Title | Title of the movie |
| Movie_Path | Full path to the movie |
| Movie_ImdbId | IMDB ID for the movie |
| MovieFile_Id | Internal ID of the episode file |
| MovieFile_RelativePath | Path to the episode file relative to the movie' path |
| MovieFile_Path | Full path to the episode file |
| MovieFile_Quality | Quality name from Radarr |
| MovieFile_QualityVersion | 1 is the default, 2 for proper, 3+ could be used for anime versions |
| MovieFile_ReleaseGroup | Release group, will not be set if it is unknown |
| MovieFile_SceneName | Original release name |
| MovieFile_SourcePath | Full path to the episode file that was imported |
| MovieFile_SourceFolder | Full path to the folder the episode file was imported from |
##### On Rename #####
| Environment Variable | Details |
|---|---|
| EventType | Rename |
| Movie_Id | Internal ID of the movie |
| Movie_Title | Title of the movie |
| Movie_Path | Full path to the movie |
| Movie_TvdbId | TVDB ID for the movie |
### Specific usage tips ###
#### PHP ####
The information from Radarr will not be added to $_ENV as one might expect but should be included in the [$_SERVER variable](https://secure.php.net/manual/en/reserved.variables.server.php). A sample script to use this information to convert a file can be found [here](https://gist.github.com/karbowiak/7fb38d346e368edc9d1a).
#### PowerShell ####
Sample script using the Radarr environment variables to create EDL files for all episodes is [here](https://gist.github.com/RedsGT/e1b5f28e7b5b81e1e45378151e73ba5c).