Skip to content

Commit

Permalink
Fixed subdivx issue with foreign title encoding issue. #2395
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Feb 17, 2024
1 parent 8ea3884 commit 43d313a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions libs/subliminal_patch/providers/subdivx.py
Expand Up @@ -78,12 +78,16 @@ def get_matches(self, video):
# episode
if isinstance(video, Episode):
# already matched within provider
matches.update(["title", "series", "season", "episode", "year"])
matches.update(["title", "series", "season", "episode"])
if str(video.year) in self.release_info:
matches.update(["year"])

# movie
elif isinstance(video, Movie):
# already matched within provider
matches.update(["title", "year"])
matches.update(["title"])
if str(video.year) in self.release_info:
matches.update(["year"])

update_matches(matches, video, self._description)

Expand Down Expand Up @@ -184,6 +188,10 @@ def _handle_search(self, query, video):
# Make the POST request
response = self.session.post(search_link, data=payload)

if response.status_code == 500:
logger.debug("Error 500 (probably bad encoding of query causing issue on provider side): %s", query)
return []

# Ensure it was successful
response.raise_for_status()

Expand Down

0 comments on commit 43d313a

Please sign in to comment.