diff options
author | Antoine Aflalo <[email protected]> | 2022-09-26 18:09:41 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2022-09-26 18:09:41 -0400 |
commit | 5413f31b41d61de59c39eba29be1d516e33dc3eb (patch) | |
tree | 15c8f6b48625055a094ba2051912aef35407e08d | |
parent | 56fb27aab47f1551914390f319ca74c81b728e84 (diff) | |
download | bazarr-5413f31b41d61de59c39eba29be1d516e33dc3eb.tar.gz bazarr-5413f31b41d61de59c39eba29be1d516e33dc3eb.zip |
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.
-rw-r--r-- | libs/subliminal_patch/providers/gestdown.py | 7 |
1 files 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() |