Skip to content

Instantly share code, notes, and snippets.

@Tetrax-10
Created July 11, 2024 06:47
Show Gist options
  • Save Tetrax-10/7eff1f8c81cbb64adb9d7e7d27ee0258 to your computer and use it in GitHub Desktop.
Save Tetrax-10/7eff1f8c81cbb64adb9d7e7d27ee0258 to your computer and use it in GitHub Desktop.
To clear your TMDB watchlist, run this code in the dev-tools console tab on your watchlist page. This code removes the first 100 items from your list. If you have more than 100 items, reload the page and run the code again until your watchlist is empty.
document.querySelectorAll(`.details .title a[href^="/movie"], .details .title a[href^="/tv"]`).forEach(async (titleElement) => {
const titleType = titleElement.href.split("/")[3]
const titleId = titleElement.href.split("/")[4]
const rawres = await fetch(`https://www.themoviedb.org/${titleType}/${titleId}/toggle-list-item?translate=false`, {
method: "PUT",
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
},
body: "type=watchlist",
})
const res = await rawres.json()
console.log(res.message)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment