|
8 | 8 | from mov_cli.http_client import HTTPClient |
9 | 9 | from mov_cli.scraper import ScraperOptionsT |
10 | 10 |
|
11 | | -from mov_cli import Single, Multi, Metadata, MetadataType |
| 11 | +from platform import uname |
12 | 12 |
|
13 | 13 | from mov_cli.scraper import Scraper |
14 | 14 | from mov_cli.utils import EpisodeSelector |
15 | 15 | from mov_cli.errors import MovCliException |
16 | | -from platform import uname |
| 16 | +from mov_cli import Single, Multi, Metadata, MetadataType |
17 | 17 |
|
18 | 18 | __all__ = ("JellyfinScraper", ) |
19 | 19 |
|
20 | 20 | class JellyfinScraper(Scraper): |
21 | 21 | def __init__(self, config: Config, http_client: HTTPClient, options: Optional[ScraperOptionsT] = None) -> None: |
22 | | - self.base_url = options.get("url") |
23 | | - self.username = options.get("username") |
24 | | - self.password = options.get("password") |
| 22 | + env_config = config.get_env_config() |
| 23 | + |
| 24 | + self.base_url = env_config("JELLY_URL", default = None, cast = str) |
| 25 | + self.username = env_config("JELLY_USERNAME", default = None, cast = str) |
| 26 | + self.password = env_config("JELLY_PASSWORD", default = None, cast = str) |
25 | 27 |
|
26 | 28 | self.uuid = uname().node # NOTE: To prevent of multiple device detections |
27 | 29 |
|
28 | 30 | super().__init__(config, http_client, options) |
29 | 31 |
|
30 | 32 | self.new_headers, self.user_id, self.api_key = self.__get_auth() |
31 | | - |
| 33 | + |
32 | 34 | def __get_auth(self): |
33 | 35 | auth_data = { |
34 | 36 | "username": self.username, |
|
0 commit comments