mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-02 21:24:20 -04:00
Add tvdb api keys config
This commit is contained in:
parent
5f61f4d3a3
commit
d08a86a724
@ -37,9 +37,14 @@ GOCODER_PRESET=fast
|
|||||||
# You can input multiple api keys separated by a ,
|
# You can input multiple api keys separated by a ,
|
||||||
KYOO_APIKEYS=t7H5!@4iMNsAaSJQ49pat4jprJgTcF656if#J3
|
KYOO_APIKEYS=t7H5!@4iMNsAaSJQ49pat4jprJgTcF656if#J3
|
||||||
|
|
||||||
# Keep this empty to use kyoo's default api key. You can also specify a custom API key if you want.
|
# Keep those empty to use kyoo's default api key. You can also specify a custom API key if you want.
|
||||||
# To get one, go to https://www.themoviedb.org/settings/api and copy the api key (not the read access token, the api key)
|
# go to https://www.themoviedb.org/settings/api and copy the api key (not the read access token, the api key)
|
||||||
THEMOVIEDB_APIKEY=
|
THEMOVIEDB_APIKEY=
|
||||||
|
# go to https://thetvdb.com/api-information/signup and copy the api key
|
||||||
|
TVDB_APIKEY=
|
||||||
|
# you can also input your subscriber's pin to support TVDB
|
||||||
|
TVDB_PIN=
|
||||||
|
|
||||||
|
|
||||||
# The url you can use to reach your kyoo instance. This is used during oidc to redirect users to your instance.
|
# The url you can use to reach your kyoo instance. This is used during oidc to redirect users to your instance.
|
||||||
PUBLIC_URL=http://localhost:5000
|
PUBLIC_URL=http://localhost:5000
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
from logging import getLogger
|
||||||
import os
|
import os
|
||||||
from aiohttp import ClientSession
|
from aiohttp import ClientSession
|
||||||
from abc import abstractmethod, abstractproperty
|
from abc import abstractmethod, abstractproperty
|
||||||
@ -11,6 +12,8 @@ from .types.episode import Episode
|
|||||||
from .types.movie import Movie
|
from .types.movie import Movie
|
||||||
from .types.collection import Collection
|
from .types.collection import Collection
|
||||||
|
|
||||||
|
logger = getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Provider:
|
class Provider:
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -29,6 +32,14 @@ class Provider:
|
|||||||
tmdb = TheMovieDatabase(languages, client, tmdb)
|
tmdb = TheMovieDatabase(languages, client, tmdb)
|
||||||
providers.append(tmdb)
|
providers.append(tmdb)
|
||||||
|
|
||||||
|
from providers.implementations.thetvdb import TVDB
|
||||||
|
|
||||||
|
tvdb = os.environ.get("TVDB_APIKEY") or TVDB.DEFAULT_API_KEY
|
||||||
|
if tvdb != "disabled":
|
||||||
|
pin = os.environ.get("TVDB_PIN") or None
|
||||||
|
tvdb = TVDB(client, tvdb, pin, languages)
|
||||||
|
providers.append(tvdb)
|
||||||
|
|
||||||
if not any(providers):
|
if not any(providers):
|
||||||
raise ProviderError(
|
raise ProviderError(
|
||||||
"No provider configured. You probably forgot to specify an API Key"
|
"No provider configured. You probably forgot to specify an API Key"
|
||||||
@ -37,6 +48,7 @@ class Provider:
|
|||||||
from providers.implementations.thexem import TheXem
|
from providers.implementations.thexem import TheXem
|
||||||
|
|
||||||
provider = next(iter(providers))
|
provider = next(iter(providers))
|
||||||
|
logger.info(f"Starting with provider: {provider.name}")
|
||||||
return TheXem(client, provider)
|
return TheXem(client, provider)
|
||||||
|
|
||||||
@abstractproperty
|
@abstractproperty
|
||||||
|
Loading…
x
Reference in New Issue
Block a user