diff --git a/Mass-Delete-via-API.md b/Mass-Delete-via-API.md new file mode 100644 index 0000000..84f2e64 --- /dev/null +++ b/Mass-Delete-via-API.md @@ -0,0 +1,33 @@ +**This article can be removed when [Mass Delete](http://feathub.com/Radarr/Radarr/+3) is implemented** + +For those who need to remove a lot of movie entries from radarr after they have finished downloading to their preferred quality. At the moment this can either be done via the API, or a lot of clicking on the webui. Bash 3.0+ required. First, pull the list of movies with GET: +`curl https://example.com/radarr/api/movie -X GET -H 'X-Api-Key: xxxxxxxxx' -k > api.txt` + +This will create api.txt and enter the json response, where you can browse at your leisure. Use sed to whittle down the list: +`sed -i -e '/"id"/!d' api.txt` +The first indented column is the main id that radarr uses, the other indented id's are irrelevent: +``` +api.txt + "id": 4 + "id": 7 + "id": 68 + "id": 93 + "id": 2 + +So, id's 4, 68 and 93 are the id's required for the next step. + +Oneshot example: +`for i in 4 68 93; do curl https://example.com/radarr/api/movie/$i -X DELETE -H 'X-Api-Key: xxxxxxxxx' -k; done` + +Usage: +example.com - your url/hostname where radarr is served from +X-Api-Key - Your API key found from `https://example.com/radarr/settings/general` + +You can manually enter id's as {x..X}: +`for i in {x..X}; do curl https://example.com/radarr/api/movie/$i -X DELETE -H 'X-Api-Key: xxxxxxxxx' -k; done` + +Usage: +x - first id in series +X - last id in series + +This will remove all movies with id's from the start to the end of the series. \ No newline at end of file