From b4cbb57f29de356ddc6aa2f65e473ec2db0cead6 Mon Sep 17 00:00:00 2001 From: Benex254 Date: Sun, 11 Aug 2024 11:21:18 +0300 Subject: [PATCH] refactor: move available servers to toplevel of animeprovider package --- fastanime/cli/__init__.py | 7 +++---- fastanime/libs/anime_provider/__init__.py | 8 ++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/fastanime/cli/__init__.py b/fastanime/cli/__init__.py index 147a5bf..0680bb9 100644 --- a/fastanime/cli/__init__.py +++ b/fastanime/cli/__init__.py @@ -3,8 +3,7 @@ import signal import click from .. import __version__ -from ..libs.anime_provider import anime_sources -from ..libs.anime_provider.allanime.constants import SERVERS_AVAILABLE +from ..libs.anime_provider import SERVERS_AVAILABLE, anime_sources from ..Utility.data import anilist_sort_normalizer from .commands import LazyGroup @@ -53,7 +52,7 @@ signal.signal(signal.SIGINT, handle_exit) @click.option( "-s", "--server", - type=click.Choice([*SERVERS_AVAILABLE, "top"], case_sensitive=False), + type=click.Choice([*SERVERS_AVAILABLE, "top"]), help="Server of choice", ) @click.option( @@ -77,7 +76,7 @@ signal.signal(signal.SIGINT, handle_exit) @click.option( "-q", "--quality", - type=click.IntRange(0, 3), + type=click.Choice(["360", "720", "1080", "unknown"]), help="set the quality of the stream", ) @click.option( diff --git a/fastanime/libs/anime_provider/__init__.py b/fastanime/libs/anime_provider/__init__.py index 4ce3456..f124f6f 100644 --- a/fastanime/libs/anime_provider/__init__.py +++ b/fastanime/libs/anime_provider/__init__.py @@ -2,3 +2,11 @@ anime_sources = { "allanime": "api.AllAnimeAPI", "animepahe": "api.AnimePaheApi", } +SERVERS_AVAILABLE = [ + "sharepoint", + "dropbox", + "gogoanime", + "weTransfer", + "wixmp", + "kwik", +]