Created
October 22, 2023 22:26
-
-
Save eburlingame/8b13501c29c415c7d374a0373d2a35de to your computer and use it in GitHub Desktop.
Clear exclusion lists from Radarr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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