Script now takes a config file as an optional arg
This commit is contained in:
parent
ffa8090399
commit
66a602b06f
16
README.md
16
README.md
@ -2,10 +2,16 @@
|
||||
A small script for syncing your currently watching anime from AniList to Sonarr/Radarr.
|
||||
|
||||
## Usage
|
||||
Assuming you have [poetry](https://python-poetry.org/docs/#installation) installed:
|
||||
```sh
|
||||
cp .env.example .env
|
||||
# Update the config with your editor of choice.
|
||||
poetry install
|
||||
poetry run python3 -m al_arr_sync
|
||||
pip install git+https://git.cesium.pw/niku/al-arr-sync.git#egg=al-arr-sync
|
||||
|
||||
wget -O config.ini https://git.cesium.pw/niku/al-arr-sync/raw/branch/main/config.ini.example
|
||||
nano config.ini
|
||||
|
||||
python -m al_arr_sync
|
||||
```
|
||||
|
||||
In case you want to use a specific config:
|
||||
```sh
|
||||
python -m al_arr_sync ~/home/.config/al-arr-sync/config.ini
|
||||
```
|
||||
|
@ -1,4 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
import typing
|
||||
|
||||
from al_arr_sync.anilist import AniListClient
|
||||
from al_arr_sync.radarr import RadarrClient
|
||||
@ -7,8 +8,9 @@ from al_arr_sync.types import DlAutomator
|
||||
from al_arr_sync.config import load_config
|
||||
|
||||
|
||||
def main() -> int:
|
||||
cfg = load_config("config.ini")
|
||||
def main(args: typing.Sequence[str]) -> int:
|
||||
cfg_path = args[0] if len(args) > 0 else "./config.ini"
|
||||
cfg = load_config(cfg_path)
|
||||
|
||||
al = AniListClient()
|
||||
sonarr: DlAutomator = SonarrClient.from_config(cfg)
|
||||
@ -44,4 +46,4 @@ def main() -> int:
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
raise SystemExit(main(sys.argv[1:]))
|
||||
|
Loading…
x
Reference in New Issue
Block a user