Script for Sonarr (automatic deletion)

Sonarr version (exact version): 3.0.5.1144
Mono version (if Sonarr is not running on Windows): 6.12.0.122
OS: Linux
Debug logs: x
Description of issue: x

Hello

I ask for help in creating a Linux Curl or sh script that would remove a serial from Sonarr that has the “Unmonitored” status

Thx

  1. 3.0.5 is out of date; 3.0.6 is current
  2. The entire UI is lipstick on the API; do it in the UI, watch the api calls with your browser dev tools and you can go from there.

you’d need to get the series; figure out what is unmontiored and then delete

limited, incomplete API documentation is here

Yes. Thank you. I saw this, but unfortunately I did not figure out exactly how to do what I need

It works like this:

HOST=http://192.168.1.253:8989
API_KEY=4ddac9b1659b4a12bba316b22e9fa9f9

ids=$(curl --silent $HOST/api/series -X GET -H "X-Api-Key: $API_KEY" \
  | jq '.[] | select(.monitored == false) | .id')

for id in $ids; do
  echo "Deleting movie id $id"
  curl --silent $HOST/api/series/$id -X DELETE -H "X-Api-Key: $API_KEY"
done

How to make it so that when I delete a series through Plex, the status monitored == false also changes in sonar. What does it have to do not for each episode separately, but for the whole series?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.