From a7ba0f950b6f0de3dae8b95b26ad8d5a5054f2d1 Mon Sep 17 00:00:00 2001 From: Nolan Kovacs Date: Sat, 4 Apr 2026 15:21:19 -0400 Subject: [PATCH] a --- dist/stock_screener.py | 25 ++++++++++++++----------- updater.py | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/dist/stock_screener.py b/dist/stock_screener.py index a97d68a..30c2949 100644 --- a/dist/stock_screener.py +++ b/dist/stock_screener.py @@ -996,18 +996,21 @@ def _fetch_edgar_bulk(close_map: dict[str, pd.Series]) -> dict[str, dict]: # Analyst + Fundamentals Cache (Verimund API) # --------------------------------------------------------------------------- -if not getattr(sys, "frozen", False): - import os as _os - _root = _os.path.dirname(_os.path.dirname(_os.path.abspath(__file__))) - if _root not in sys.path: - sys.path.insert(0, _root) - del _os +_API_URL = "https://api.verimundsolutions.com" -try: - from license_check import _API_URL as _API_URL, get_api_headers as _get_api_headers -except ImportError: - _API_URL = None - _get_api_headers = lambda: {} +def _get_api_headers() -> dict: + """Read JWT from the auth cache file directly — no dependency on obfuscated license_check.""" + try: + import json as _json + _cache = os.path.join( + os.environ.get("APPDATA", os.path.expanduser("~")), + "StockScreener", "auth_cache.dat" + ) + with open(_cache, "r", encoding="utf-8") as _f: + _tok = _json.load(_f).get("jwt_token", "") + return {"Authorization": f"Bearer {_tok}", "Content-Type": "application/json"} + except Exception: + return {"Content-Type": "application/json"} def _load_analyst_cache() -> dict[str, dict]: diff --git a/updater.py b/updater.py index a340733..727fd34 100644 --- a/updater.py +++ b/updater.py @@ -19,7 +19,7 @@ import requests # --------------------------------------------------------------------------- # Current app version — kept in sync by push_update.py before each build. # --------------------------------------------------------------------------- -APP_VERSION = "1.4.5" +APP_VERSION = "1.4.6" def _exe_dir() -> str: