From 1b016325d082b84a15abb9daa2ad77a74732a313 Mon Sep 17 00:00:00 2001 From: Jacky Lai Date: Sun, 22 Sep 2024 19:42:14 -0400 Subject: [PATCH] Use cloudflare worker as proxy --- extensions/letterboxd/src/index.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/extensions/letterboxd/src/index.ts b/extensions/letterboxd/src/index.ts index 9f31e2a..dbc9ed9 100644 --- a/extensions/letterboxd/src/index.ts +++ b/extensions/letterboxd/src/index.ts @@ -122,15 +122,8 @@ class ExtensionTemplate extends WorkerExtension { } async onEnterPressedOnSearchBar(): Promise { - const url = `https://api.themoviedb.org/3/search/movie?query=${encodeURIComponent(this.searchTerm)}&include_adult=false&language=en-US&page=1`; - const options = { - method: 'GET', - headers: { - accept: 'application/json', - Authorization: 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJiMDA3MWRhNzJmZDYxNmJhODFkZDBhMWYxZDdiNjk5YSIsIm5iZiI6MTcyNTc0MDQwOS4wOTg1NjcsInN1YiI6IjVlZjY2NGNlMTNhZjVmMDAzNDUzNzg1YyIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.fntcyR0fqs6lDfOTC27ZLMqlKL7b2rerJEV10IIet6c' - } - }; - const searchData = await (await fetch(url, options)).json(); + const url = `https://tmdb-kunkun.jackyklai.workers.dev/?search=${encodeURIComponent(this.searchTerm)}`; + const searchData = await (await fetch(url)).json(); let actions = convertActions(generalActions) if (this.currentLetterboxdUsername) { actions = actions.concat(convertActions(friendsActions))