From fe38cd65b8ea2d002ec4836e53e337c89cce216a Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 12 May 2024 21:32:14 +0200 Subject: [PATCH] Include tmdb api keys by default (#488) --- .env.example | 2 ++ INSTALLING.md | 8 ++------ scanner/providers/implementations/themoviedatabase.py | 2 ++ scanner/providers/provider.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index ed12ec45..fbd997ee 100644 --- a/.env.example +++ b/.env.example @@ -37,6 +37,8 @@ GOCODER_PRESET=fast # You can input multiple api keys separated by a , 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. +# To get one, go to https://www.themoviedb.org/settings/api and copy the api key (not the read access token, the api key) THEMOVIEDB_APIKEY= # The url you can use to reach your kyoo instance. This is used during oidc to redirect users to your instance. diff --git a/INSTALLING.md b/INSTALLING.md index bc8ca28b..a8bc72cb 100644 --- a/INSTALLING.md +++ b/INSTALLING.md @@ -4,7 +4,7 @@ 2. Download the [`docker-compose.yml`](https://github.com/zoriya/kyoo/releases/latest/download/docker-compose.yml) and [`.env`](https://raw.githubusercontent.com/zoriya/Kyoo/master/.env.example) files -3. Fill the `.env` file with your configuration options (and an API Key from [themoviedb.org](https://www.themoviedb.org/)) +3. Fill the `.env` file with your configuration options 4. Look at [Hardware Acceleration section](#Hardware-Acceleration) if you need it 5. Run `docker compose up -d` and see kyoo at `http://localhost:8901` @@ -16,7 +16,7 @@ To install Kyoo, you need docker and docker-compose. Those can be installed from or [Windows](https://docs.docker.com/desktop/install/windows-install/). Docker is used to run each services of Kyoo in an isolated environment with all the dependencies they need. -Kyoo also needs 2 files to work properly. The first should be downloaded from the latest release artificat, the other needs to be filled in with your configurations. +Kyoo also needs 2 files to work properly. The first should be downloaded from the latest release artifact, the other needs to be filled in with your configurations. Those files can be put in any directory of your choice. Those files are: @@ -28,10 +28,6 @@ Those files are: > The `docker-compose.yml` file describes the different services of Kyoo, where they should be downloaded and their start order. \ > The `.env` file contains all the configuration options that the services in `docker-compose.yml` will read. -To retrieve metadata, Kyoo will need to communicate with an external service. For now, that is `the movie database`. -For this purpose, you will need to get an API Key. For that, go to [themoviedb.org](https://www.themoviedb.org/) and create an account, then -go [here](https://www.themoviedb.org/settings/api) and copy the `API Key (v3 auth)`, paste it after the `THEMOVIEDB_APIKEY=` on the `.env` file. - If you need hardware acceleration, look at [Hardware Acceleration section](#Hardware-Acceleration) if you need it The next and last step is actually starting Kyoo. To do that, open a terminal in the same directory as the 3 configurations files diff --git a/scanner/providers/implementations/themoviedatabase.py b/scanner/providers/implementations/themoviedatabase.py index 3abb19b2..3cf99a88 100644 --- a/scanner/providers/implementations/themoviedatabase.py +++ b/scanner/providers/implementations/themoviedatabase.py @@ -22,6 +22,8 @@ logger = getLogger(__name__) class TheMovieDatabase(Provider): + DEFAULT_API_KEY = "c9f328a01011b28f22483717395fc3fa" + def __init__( self, languages: list[str], diff --git a/scanner/providers/provider.py b/scanner/providers/provider.py index ab25bf85..b6d1c8da 100644 --- a/scanner/providers/provider.py +++ b/scanner/providers/provider.py @@ -24,8 +24,8 @@ class Provider: from providers.implementations.themoviedatabase import TheMovieDatabase - tmdb = os.environ.get("THEMOVIEDB_APIKEY") - if tmdb: + tmdb = os.environ.get("THEMOVIEDB_APIKEY") or TheMovieDatabase.DEFAULT_API_KEY + if tmdb != "disabled": tmdb = TheMovieDatabase(languages, client, tmdb) providers.append(tmdb)