Skip to content

Commit

Permalink
Merge pull request #627 from AbdullahM0hamed/subsplease
Browse files Browse the repository at this point in the history
Subsplease: more helpful error when there are no search results
  • Loading branch information
AbdullahM0hamed committed Feb 12, 2021
2 parents 0229cd1 + f7051f4 commit a25f10a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions anime_downloader/sites/subsplease.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@

import logging
from anime_downloader.sites.anime import Anime, AnimeEpisode, SearchResult
from anime_downloader.sites import helpers

logger = logging.getLogger(__name__)


class SubsPlease(Anime, sitename="subsplease"):
sitename = "subsplease"
Expand All @@ -14,6 +17,9 @@ def search(cls, query):
resp = helpers.get(cls.api_url, params={
"f": "search", "tz": "", "s": query}).json()

if type(resp) is list:
return

# Using to deduplicate
slug_to_title_dict = dict(
[(resp[key]["show"], resp[key]["page"]) for key in resp.keys()])
Expand Down

0 comments on commit a25f10a

Please sign in to comment.