Skip to content

Instantly share code, notes, and snippets.

@eburlingame
Created October 22, 2023 22:26
Show Gist options
  • Save eburlingame/8b13501c29c415c7d374a0373d2a35de to your computer and use it in GitHub Desktop.
Save eburlingame/8b13501c29c415c7d374a0373d2a35de to your computer and use it in GitHub Desktop.
Clear exclusion lists from Radarr
// Requires Node.js v18
const { readFileSync } = require("fs");
const API_KEY = "<Radarr API key>"
const BASE_URL = "https://<Radarr URL>/api/v3";
const options = {
credentials: "omit",
headers: {
"User-Agent":
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/118.0",
Accept: "*/*",
"Accept-Language": "en-US,en;q=0.5",
"X-Api-Key": API_KEY,
"X-Requested-With": "XMLHttpRequest",
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-origin",
Pragma: "no-cache",
"Cache-Control": "no-cache",
},
referrer: BASE_URL + "/importlists",
method: "GET",
mode: "cors",
};
const main = async () => {
const result = await fetch(BASE_URL + "/exclusions", options);
const response = await result.json();
for (let { id, movieTitle } of response) {
await fetch(BASE_URL + "/exclusions/" + id, {
...options,
method: "DELETE",
});
console.log(`Removed ${movieTitle} from exclusion list`);
}
};
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment