refactor: rename API classes for consistency and clarity

This commit is contained in:
benex
2024-12-02 10:08:28 +03:00
parent 57e73e6799
commit 0667749e4c
7 changed files with 10 additions and 10 deletions

View File

@@ -3,10 +3,10 @@ from .animepahe.constants import SERVERS_AVAILABLE as ANIMEPAHE_SERVERS
from .hianime.constants import SERVERS_AVAILABLE as HIANIME_SERVERS
anime_sources = {
"allanime": "api.AllAnimeAPI",
"animepahe": "api.AnimePaheApi",
"hianime": "api.HiAnimeApi",
"nyaa": "api.NyaaApi",
"yugen": "api.YugenApi"
"allanime": "api.AllAnime",
"animepahe": "api.AnimePahe",
"hianime": "api.HiAnime",
"nyaa": "api.Nyaa",
"yugen": "api.Yugen"
}
SERVERS_AVAILABLE = [*ALLANIME_SERVERS, *ANIMEPAHE_SERVERS, *HIANIME_SERVERS]

View File

@@ -21,7 +21,7 @@ logger = logging.getLogger(__name__)
# TODO: create tests for the api
#
# ** Based on ani-cli **
class AllAnimeAPI(AnimeProvider):
class AllAnime(AnimeProvider):
"""
Provides a fast and effective interface to AllAnime site.
"""

View File

@@ -28,7 +28,7 @@ logger = logging.getLogger(__name__)
KWIK_RE = re.compile(r"Player\|(.+?)'")
class AnimePaheApi(AnimeProvider):
class AnimePahe(AnimeProvider):
search_page: "AnimePaheSearchPage"
anime: "AnimePaheAnimePage"
HEADERS = REQUEST_HEADERS

View File

@@ -39,7 +39,7 @@ class ParseAnchorAndImgTag(HTMLParser):
self.a_tag = {attr[0]: attr[1] for attr in attrs}
class HiAnimeApi(AnimeProvider):
class HiAnime(AnimeProvider):
# HEADERS = {"Referer": "https://hianime.to/home"}
PROVIDER = "hianime"

View File

@@ -27,7 +27,7 @@ EXTRACT_USEFUL_INFO_PATTERN_2 = re.compile(
)
class NyaaApi(AnimeProvider):
class Nyaa(AnimeProvider):
search_results: SearchResults
PROVIDER = "nyaa"

View File

@@ -15,7 +15,7 @@ from ..base_provider import AnimeProvider
# ** Adapted from anipy-cli **
class YugenApi(AnimeProvider):
class Yugen(AnimeProvider):
"""
Provides a fast and effective interface to YugenApi site.
"""