From 5413f31b41d61de59c39eba29be1d516e33dc3eb Mon Sep 17 00:00:00 2001 From: Antoine Aflalo Date: Mon, 26 Sep 2022 18:09:41 -0400 Subject: [PATCH] Use new endpoint for gestdown (#1949) This endpoint rely on caching from cloudflare and will better scale. Right now, I'm getting around 3M request per day, so I'd like to use the caching as much as possible. --- libs/subliminal_patch/providers/gestdown.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libs/subliminal_patch/providers/gestdown.py b/libs/subliminal_patch/providers/gestdown.py index 6474aad55..eed1e1e6a 100644 --- a/libs/subliminal_patch/providers/gestdown.py +++ b/libs/subliminal_patch/providers/gestdown.py @@ -84,13 +84,10 @@ class GestdownProvider(Provider): self._session.close() def _subtitles_search(self, video, language: Language): - json_data = { - "search": f"{video.series} S{video.season:02}E{video.episode:02}", - "language": self._converter.convert(language.alpha3), - } logger.debug("Post data: %s", json_data) - response = self._session.post(f"{_BASE_URL}/subtitles/search", json=json_data) + lang = self._converter.convert(language.alpha3) + response = self._session.get(f"{_BASE_URL}/subtitles/find/{lang}/{video.series}/{video.season}/{video.episode}") # TODO: implement rate limiting response.raise_for_status()