Skip to content

Commit c6ac838

Browse files
committed
fix: credentials should be stored in env vars. closes #1
1 parent 2cd29dc commit c6ac838

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

mov_cli_ms/jellyfin/scraper.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,29 @@
88
from mov_cli.http_client import HTTPClient
99
from mov_cli.scraper import ScraperOptionsT
1010

11-
from mov_cli import Single, Multi, Metadata, MetadataType
11+
from platform import uname
1212

1313
from mov_cli.scraper import Scraper
1414
from mov_cli.utils import EpisodeSelector
1515
from mov_cli.errors import MovCliException
16-
from platform import uname
16+
from mov_cli import Single, Multi, Metadata, MetadataType
1717

1818
__all__ = ("JellyfinScraper", )
1919

2020
class JellyfinScraper(Scraper):
2121
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)
2527

2628
self.uuid = uname().node # NOTE: To prevent of multiple device detections
2729

2830
super().__init__(config, http_client, options)
2931

3032
self.new_headers, self.user_id, self.api_key = self.__get_auth()
31-
33+
3234
def __get_auth(self):
3335
auth_data = {
3436
"username": self.username,

0 commit comments

Comments
 (0)