Skip to content

Instantly share code, notes, and snippets.

View Tetrax-10's full-sized avatar

Raghavan Tetrax-10

View GitHub Profile
@Tetrax-10
Tetrax-10 / clearTmdbWatchlist.js
Created July 11, 2024 06:47
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",