Difference between revisions of "Readarr Tips and Tricks"
Bakerboy448 (talk | contribs) (Create from Radarr) |
Bakerboy448 (talk | contribs) (add warning) |
||
Line 1: | Line 1: | ||
== Custom Post Processing Scripts == | == Custom Post Processing Scripts == | ||
− | If you’re looking to trigger a custom script in your download client to tell | + | |
+ | {| class="wikitable" style="width:70%; text-align:center; margin:auto; background-color:#dd0b1f;" | ||
+ | |- | ||
+ | ! WARNING | ||
+ | |- | ||
+ | |Readarr this page is not yet complete.<br><p style="font-size 16px;"> '''You have been WARNED!'''</p> | ||
+ | |} | ||
+ | |||
+ | |||
+ | If you’re looking to trigger a custom script in your download client to tell Readarr when to update, you can find more details here. Scripts are added to Readarr via the [[Radarr Settings#Connections|Connect Settings]] page. | ||
=== Overview === | === Overview === | ||
− | + | Readarr can execute a custom script when new movies are imported or a movie is renamed and depending on which action occurred, the parameters will be different. They are passed to the script through environment variables which allows for more flexibility in what is sent to the script and in no particular order. | |
=== Environment Variables === | === Environment Variables === | ||
Line 14: | Line 23: | ||
!width="50%"| Details | !width="50%"| Details | ||
|- | |- | ||
− | | | + | | readarr_eventtype |
| Grab | | Grab | ||
|- | |- | ||
− | | | + | | readarr_download_client |
| NZB/Torrent downloader client | | NZB/Torrent downloader client | ||
|- | |- | ||
− | | | + | | readarr_download_id |
| The hash of the torrent/NZB file downloaded (used to uniquely identify the download in the download client) | | The hash of the torrent/NZB file downloaded (used to uniquely identify the download in the download client) | ||
|- | |- | ||
− | | | + | | readarr_movie_id |
| Internal ID of the movie | | Internal ID of the movie | ||
|- | |- | ||
− | | | + | | readarr_movie_imdbid |
| IMDb ID for the movie | | IMDb ID for the movie | ||
|- | |- | ||
− | | | + | | readarr_movie_in_cinemas_date |
| Cinema release date | | Cinema release date | ||
|- | |- | ||
− | | | + | | readarr_movie_physical_release_date |
| Physical release date | | Physical release date | ||
|- | |- | ||
− | | | + | | readarr_movie_title |
| Title of the movie | | Title of the movie | ||
|- | |- | ||
− | | | + | | readarr_movie_tmdbid |
| TMDb ID for the movie | | TMDb ID for the movie | ||
|- | |- | ||
− | | | + | | readarr_movie_year |
| Release year of the movie | | Release year of the movie | ||
|- | |- | ||
− | | | + | | readarr_release_indexer |
| Indexer where the release was grabbed | | Indexer where the release was grabbed | ||
|- | |- | ||
− | | | + | | readarr_release_quality |
− | | Quality name from | + | | Quality name from Readarr |
|- | |- | ||
− | | | + | | readarr_release_qualityversion |
| 1 is the default, 2 for proper, 3+ could be used for anime versions | | 1 is the default, 2 for proper, 3+ could be used for anime versions | ||
|- | |- | ||
− | | | + | | readarr_release_releasegroup |
| Release Group, will not be set if it is unknown | | Release Group, will not be set if it is unknown | ||
|- | |- | ||
− | | | + | | readarr_release_size |
| Size of the release reported by the indexer | | Size of the release reported by the indexer | ||
|- | |- | ||
− | | | + | | readarr_release_title |
| NZB/Torrent title | | NZB/Torrent title | ||
|} | |} | ||
Line 69: | Line 78: | ||
!width="50%"| Details | !width="50%"| Details | ||
|- | |- | ||
− | | | + | | readarr_eventtype |
| Download | | Download | ||
|- | |- | ||
− | | | + | | readarr_download_id |
| The hash of the torrent/NZB file downloaded (used to uniquely identify the download in the download client) | | The hash of the torrent/NZB file downloaded (used to uniquely identify the download in the download client) | ||
|- | |- | ||
− | | | + | | readarr_isupgrade |
| <code>True</code> when an existing file is upgraded, otherwise <code>False</code> | | <code>True</code> when an existing file is upgraded, otherwise <code>False</code> | ||
|- | |- | ||
− | | | + | | readarr_movie_id |
| Internal ID of the movie | | Internal ID of the movie | ||
|- | |- | ||
− | | | + | | readarr_movie_imdbid |
| IMDb ID for the movie | | IMDb ID for the movie | ||
|- | |- | ||
− | | | + | | readarr_movie_in_cinemas_date |
| Cinema release date | | Cinema release date | ||
|- | |- | ||
− | | | + | | readarr_movie_physical_release_date |
| Physical release date | | Physical release date | ||
|- | |- | ||
− | | | + | | readarr_movie_path |
| Full path to the movie ( /Movie (Year)/ ) | | Full path to the movie ( /Movie (Year)/ ) | ||
|- | |- | ||
− | | | + | | readarr_movie_title |
| Title of the movie | | Title of the movie | ||
|- | |- | ||
− | | | + | | readarr_movie_tmdbid |
| TMDb ID for the movie | | TMDb ID for the movie | ||
|- | |- | ||
− | | | + | | readarr_movie_year |
| Release year of the movie | | Release year of the movie | ||
|- | |- | ||
− | | | + | | readarr_moviefile_id |
| Internal ID of the movie file | | Internal ID of the movie file | ||
|- | |- | ||
− | | | + | | readarr_moviefile_relativepath |
| Path to the movie file relative to the movie’ path | | Path to the movie file relative to the movie’ path | ||
|- | |- | ||
− | | | + | | readarr_moviefile_path |
| Full path to the movie file ( /Movie (Year)/Movie (Year).mkv ) | | Full path to the movie file ( /Movie (Year)/Movie (Year).mkv ) | ||
|- | |- | ||
− | | | + | | readarr_moviefile_quality |
− | | Quality name from | + | | Quality name from Readarr |
|- | |- | ||
− | | | + | | readarr_moviefile_qualityversion |
| 1 is the default, 2 for proper, 3+ could be used for anime versions | | 1 is the default, 2 for proper, 3+ could be used for anime versions | ||
|- | |- | ||
− | | | + | | readarr_moviefile_releasegroup |
| Release group, will not be set if it is unknown | | Release group, will not be set if it is unknown | ||
|- | |- | ||
− | | | + | | readarr_moviefile_scenename |
| Original release name | | Original release name | ||
|- | |- | ||
− | | | + | | readarr_moviefile_sourcepath |
| Full path to the movie file that was imported | | Full path to the movie file that was imported | ||
|- | |- | ||
− | | | + | | readarr_moviefile_sourcefolder |
| Full path to the folder the movie file was imported from | | Full path to the folder the movie file was imported from | ||
|} | |} | ||
Line 136: | Line 145: | ||
! Details | ! Details | ||
|- | |- | ||
− | | | + | | readarr_eventtype |
| Rename | | Rename | ||
|- | |- | ||
− | | | + | | readarr_movie_id |
| Internal ID of the movie | | Internal ID of the movie | ||
|- | |- | ||
− | | | + | | readarr_movie_imdbid |
| IMDb ID for the movie | | IMDb ID for the movie | ||
|- | |- | ||
− | | | + | | readarr_movie_in_cinemas_date |
| Cinema release date | | Cinema release date | ||
|- | |- | ||
− | | | + | | readarr_movie_path |
| Full path to the movie | | Full path to the movie | ||
|- | |- | ||
− | | | + | | readarr_movie_physical_release_date |
| Physical release date | | Physical release date | ||
|- | |- | ||
− | | | + | | readarr_movie_title |
| Title of the movie | | Title of the movie | ||
|- | |- | ||
− | | | + | | readarr_movie_tmdbid |
| TMDb ID for the movie | | TMDb ID for the movie | ||
|- | |- | ||
− | | | + | | readarr_movie_year |
| Release year of the movie | | Release year of the movie | ||
|} | |} | ||
Line 229: | Line 238: | ||
==== PHP ==== | ==== PHP ==== | ||
− | The information from | + | The information from Readarr will not be added to <math display="inline">_ENV as one might expect but should be included in the [</math>_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 [https://gist.github.com/karbowiak/7fb38d346e368edc9d1a here]. #### PowerShell #### Sample script using the Readarr environment variables to create EDL files for all episodes is [https://gist.github.com/RedsGT/e1b5f28e7b5b81e1e45378151e73ba5c here]. |
Sample script to have Plex scan destination folder only and “analyze deeply” the file. PSQLite needed to query the plex DB. Adjust folder locations to match your setup. | Sample script to have Plex scan destination folder only and “analyze deeply” the file. PSQLite needed to query the plex DB. Adjust folder locations to match your setup. | ||
Line 274: | Line 283: | ||
==== Reverse Symlinking ==== | ==== Reverse Symlinking ==== | ||
− | When using private trackers, it is imperative to continue seeding. By using this script <code>on Download</code> and <code>on Upgrade</code> moves the media to your root movie folder as set in | + | When using private trackers, it is imperative to continue seeding. By using this script <code>on Download</code> and <code>on Upgrade</code> moves the media to your root movie folder as set in Readarr, and will create a symlink in the original download location so you can continue to seed. |
Symlinking is preferable over hardlinking in some cases as the root movie folder can be on a seperate drive or nfs mount, where hardlinks are impossible. | Symlinking is preferable over hardlinking in some cases as the root movie folder can be on a seperate drive or nfs mount, where hardlinks are impossible. |
Latest revision as of 02:40, 24 December 2020
Custom Post Processing Scripts
WARNING |
---|
Readarr this page is not yet complete. You have been WARNED! |
If you’re looking to trigger a custom script in your download client to tell Readarr when to update, you can find more details here. Scripts are added to Readarr via the Connect Settings page.
Overview
Readarr can execute a custom script when new movies are imported or a movie is renamed and depending on which action occurred, the parameters will be different. They are passed to the script through environment variables which allows for more flexibility in what is sent to the script and in no particular order.
Environment Variables
On Grab
Environment Variable | Details |
---|---|
readarr_eventtype | Grab |
readarr_download_client | NZB/Torrent downloader client |
readarr_download_id | The hash of the torrent/NZB file downloaded (used to uniquely identify the download in the download client) |
readarr_movie_id | Internal ID of the movie |
readarr_movie_imdbid | IMDb ID for the movie |
readarr_movie_in_cinemas_date | Cinema release date |
readarr_movie_physical_release_date | Physical release date |
readarr_movie_title | Title of the movie |
readarr_movie_tmdbid | TMDb ID for the movie |
readarr_movie_year | Release year of the movie |
readarr_release_indexer | Indexer where the release was grabbed |
readarr_release_quality | Quality name from Readarr |
readarr_release_qualityversion | 1 is the default, 2 for proper, 3+ could be used for anime versions |
readarr_release_releasegroup | Release Group, will not be set if it is unknown |
readarr_release_size | Size of the release reported by the indexer |
readarr_release_title | NZB/Torrent title |
On Download/On Upgrade
Environment Variable | Details |
---|---|
readarr_eventtype | Download |
readarr_download_id | The hash of the torrent/NZB file downloaded (used to uniquely identify the download in the download client) |
readarr_isupgrade | True when an existing file is upgraded, otherwise False
|
readarr_movie_id | Internal ID of the movie |
readarr_movie_imdbid | IMDb ID for the movie |
readarr_movie_in_cinemas_date | Cinema release date |
readarr_movie_physical_release_date | Physical release date |
readarr_movie_path | Full path to the movie ( /Movie (Year)/ ) |
readarr_movie_title | Title of the movie |
readarr_movie_tmdbid | TMDb ID for the movie |
readarr_movie_year | Release year of the movie |
readarr_moviefile_id | Internal ID of the movie file |
readarr_moviefile_relativepath | Path to the movie file relative to the movie’ path |
readarr_moviefile_path | Full path to the movie file ( /Movie (Year)/Movie (Year).mkv ) |
readarr_moviefile_quality | Quality name from Readarr |
readarr_moviefile_qualityversion | 1 is the default, 2 for proper, 3+ could be used for anime versions |
readarr_moviefile_releasegroup | Release group, will not be set if it is unknown |
readarr_moviefile_scenename | Original release name |
readarr_moviefile_sourcepath | Full path to the movie file that was imported |
readarr_moviefile_sourcefolder | Full path to the folder the movie file was imported from |
On Rename
Environment Variable | Details |
---|---|
readarr_eventtype | Rename |
readarr_movie_id | Internal ID of the movie |
readarr_movie_imdbid | IMDb ID for the movie |
readarr_movie_in_cinemas_date | Cinema release date |
readarr_movie_path | Full path to the movie |
readarr_movie_physical_release_date | Physical release date |
readarr_movie_title | Title of the movie |
readarr_movie_tmdbid | TMDb ID for the movie |
readarr_movie_year | Release year of the movie |
Specific usage tips
LINUX / UNIX Scripts
Remember to always add a shebang and make your scripts executable with chmod.
PHP
The information from Readarr will not be added to <math display="inline">_ENV as one might expect but should be included in the [</math>_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. #### PowerShell #### Sample script using the Readarr environment variables to create EDL files for all episodes is here.
Sample script to have Plex scan destination folder only and “analyze deeply” the file. PSQLite needed to query the plex DB. Adjust folder locations to match your setup.
This script will add the movie to plex and scan the destination folder (it will not scan the entire library)
Reverse Symlinking
When using private trackers, it is imperative to continue seeding. By using this script on Download
and on Upgrade
moves the media to your root movie folder as set in Readarr, and will create a symlink in the original download location so you can continue to seed.
Symlinking is preferable over hardlinking in some cases as the root movie folder can be on a seperate drive or nfs mount, where hardlinks are impossible.
A quick way to test scripts is to create a testing environment using the movie “Test (2013)”.
mkdir -p ~/test && cd ~/test && touch "Test (2013).nfo" "Test (2013).por.srt" "Test (2013).por.forced.srt" "Test (2013).eng.srt" "Test (2013).mkv" && cp -R ~/test /path/to/folder/to/import
or in bash:
mkdir -p ~/test && cd ~/test && touch "Test (2013)."{nfo,por.srt,por.forced.srt,eng.srt,mkv} && cp -R ~/test /path/to/folder/to/import
This way you can manually import this movie and trigger the script. You can just run it again to repopulate the files.