Compare commits

...

4 commits

6 changed files with 18 additions and 10 deletions

View file

@ -7,9 +7,9 @@ RUN wget -q https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVE
&& tar xvf $GECKODRIVER_FILENAME \
&& rm $GECKODRIVER_FILENAME
FROM python:3.11-slim-bullseye as final
FROM python:3.11-slim-bookworm as final
RUN apt-get update && apt-get install -y firefox-esr
COPY --from=downloader /app/geckodriver /usr/local/bin/geckodriver
ARG OFX_VERSION
RUN pip install ofx-processor==$OFX_VERSION
RUN pip --disable-pip-version-check install --quiet ofx-processor==$OFX_VERSION
CMD ["ynab", "lcl", "--download"]

BIN
error_download_lcl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

View file

@ -39,7 +39,7 @@ class LclDownloader:
try:
return self._download()
except Exception:
screenshot = Path(os.getenv("SCREENSHOT_DIR", default="/tmp")) / "error_download.png"
screenshot = Path(self.config.screenshot_dir) / "error_download_lcl.png"
self.selenium.save_screenshot(screenshot)
raise
@ -62,12 +62,15 @@ class LclDownloader:
self._click(By.CLASS_NAME, "app-cta-button")
click.secho("Logged in!", fg="green")
try:
self._click(By.CSS_SELECTOR, ".app-cta-button--primary")
click.secho("Dismissing welcome screen...", fg="blue")
time.sleep(2)
except NoSuchElementException:
click.secho("No welcome screen found.", fg="blue")
retry = True
while retry:
try:
self._click(By.CSS_SELECTOR, ".app-cta-button--primary")
click.secho("Dismissing welcome screen...", fg="blue")
time.sleep(1)
except NoSuchElementException:
click.secho("No welcome screen found.", fg="blue")
retry = False
try:
self._click(By.CSS_SELECTOR, ".burger-menu-content")

View file

@ -17,6 +17,7 @@ def get_default_config():
default_config["DEFAULT"] = {
"token": "<YOUR API TOKEN>",
"budget": "<YOUR BUDGET ID>",
"screenshot_dir": "/tmp",
"mailgun_api_key": "",
"mailgun_domain": "",
"mailgun_from": "",
@ -76,6 +77,7 @@ class Config:
account: str
budget_id: str
token: str
screenshot_dir: str
bank_identifier: Optional[str] = None
bank_password: Optional[str] = None
mailgun_api_key: Optional[str] = None
@ -152,6 +154,7 @@ def get_config(account: str) -> Config:
section = config[account]
budget_id = section["budget"]
token = section["token"]
screenshot_dir = section.get("screenshot_dir")
if account == "DEFAULT":
ynab_account_id = ""
else:
@ -174,6 +177,7 @@ def get_config(account: str) -> Config:
ynab_account_id,
budget_id,
token,
screenshot_dir,
bank_identifier,
bank_password,
mailgun_api_key,

View file

@ -1,6 +1,6 @@
[tool.poetry]
name = "ofx-processor"
version = "4.4.3"
version = "4.4.6"
description = "Personal ofx processor"
readme = "README.md"
authors = ["Gabriel Augendre <gabriel@augendre.info>"]

View file

@ -1,6 +1,7 @@
[DEFAULT]
token = <YOUR API TOKEN>
budget = <YOUR BUDGET ID>
screenshot_dir = /tmp
[bpvf]
account = <YOUR BPVF ACCOUNT ID>