diff --git a/app/api/endpoints/meta.py b/app/api/endpoints/meta.py
index eb92cf2..db2367d 100644
--- a/app/api/endpoints/meta.py
+++ b/app/api/endpoints/meta.py
@@ -8,43 +8,50 @@
router = APIRouter()
+async def fetch_languages_list():
+ """
+ Fetch and format languages list from TMDB.
+ Returns a list of language dictionaries with iso_639_1, language, and country.
+ """
+ tmdb = get_tmdb_service()
+ tasks = [
+ tmdb.get_primary_translations(),
+ tmdb.get_languages(),
+ tmdb.get_countries(),
+ ]
+ primary_translations, languages, countries = await asyncio.gather(*tasks)
+
+ language_map = {lang["iso_639_1"]: lang["english_name"] for lang in languages}
+ country_map = {country["iso_3166_1"]: country["english_name"] for country in countries}
+
+ result = []
+ for element in primary_translations:
+ # element looks like "en-US"
+ parts = element.split("-")
+ if len(parts) != 2:
+ continue
+
+ lang_code, country_code = parts
+ language_name = language_map.get(lang_code)
+ country_name = country_map.get(country_code)
+
+ if language_name and country_name:
+ result.append(
+ {
+ "iso_639_1": element,
+ "language": language_name,
+ "country": country_name,
+ }
+ )
+ result.sort(key=lambda x: (x["iso_639_1"] != "en-US", x["language"]))
+ return result
+
+
@router.get("/api/languages")
async def get_languages():
try:
- tmdb = get_tmdb_service()
- tasks = [
- tmdb.get_primary_translations(),
- tmdb.get_languages(),
- tmdb.get_countries(),
- ]
- primary_translations, languages, countries = await asyncio.gather(*tasks)
-
- language_map = {lang["iso_639_1"]: lang["english_name"] for lang in languages}
-
- country_map = {country["iso_3166_1"]: country["english_name"] for country in countries}
-
- result = []
- for element in primary_translations:
- # element looks like "en-US"
- parts = element.split("-")
- if len(parts) != 2:
- continue
-
- lang_code, country_code = parts
-
- language_name = language_map.get(lang_code)
- country_name = country_map.get(country_code)
-
- if language_name and country_name:
- result.append(
- {
- "iso_639_1": element,
- "language": language_name,
- "country": country_name,
- }
- )
- return result
-
+ languages = await fetch_languages_list()
+ return languages
except Exception as e:
logger.error(f"Failed to fetch languages: {e}")
raise HTTPException(status_code=502, detail="Failed to fetch languages from TMDB")
diff --git a/app/core/app.py b/app/core/app.py
index a0bb7f6..a640169 100644
--- a/app/core/app.py
+++ b/app/core/app.py
@@ -1,4 +1,3 @@
-import os
from contextlib import asynccontextmanager
from pathlib import Path
@@ -7,14 +6,20 @@
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
+from jinja2 import Environment, FileSystemLoader
from loguru import logger
+from app.api.endpoints.meta import fetch_languages_list
from app.api.main import api_router
from app.services.token_store import token_store
from .config import settings
from .version import __version__
+project_root = Path(__file__).resolve().parent.parent.parent
+static_dir = project_root / "app/static"
+templates_dir = project_root / "app/templates"
+
@asynccontextmanager
async def lifespan(app: FastAPI):
@@ -46,11 +51,8 @@ async def lifespan(app: FastAPI):
allow_headers=["*"],
)
-
-# Simple IP-based rate limiter for repeated probes of missing tokens.
-# Tracks recent failure counts per IP to avoid expensive repeated requests.
_ip_failure_cache: TTLCache = TTLCache(maxsize=10000, ttl=600)
-_IP_FAILURE_THRESHOLD = 8
+IP_FAILURE_THRESHOLD = 8
@app.middleware("http")
@@ -66,7 +68,7 @@ async def block_missing_token_middleware(request: Request, call_next):
_ip_failure_cache[ip] = _ip_failure_cache.get(ip, 0) + 1
except Exception:
pass
- if _ip_failure_cache.get(ip, 0) > _IP_FAILURE_THRESHOLD:
+ if _ip_failure_cache.get(ip, 0) > IP_FAILURE_THRESHOLD:
return HTMLResponse(content="Too many requests", status_code=429)
return HTMLResponse(content="Invalid token", status_code=401)
except Exception:
@@ -74,42 +76,33 @@ async def block_missing_token_middleware(request: Request, call_next):
return await call_next(request)
-# Serve static files
-# app/core/app.py -> app/core -> app -> root
-project_root = Path(__file__).resolve().parent.parent.parent
-static_dir = project_root / "app/static"
-
if static_dir.exists():
app.mount("/app/static", StaticFiles(directory=str(static_dir)), name="static")
+# Initialize Jinja2 templates
+jinja_env = Environment(loader=FileSystemLoader(str(templates_dir)))
+
-# Serve index.html at /configure and /{token}/configure
@app.get("/", response_class=HTMLResponse)
@app.get("/configure", response_class=HTMLResponse)
@app.get("/{token}/configure", response_class=HTMLResponse)
-async def configure_page(token: str | None = None):
- index_path = static_dir / "index.html"
- if index_path.exists():
- with open(index_path, encoding="utf-8") as file:
- html_content = file.read()
- dynamic_announcement = os.getenv("ANNOUNCEMENT_HTML")
- if dynamic_announcement is None:
- dynamic_announcement = settings.ANNOUNCEMENT_HTML
- announcement_html = (dynamic_announcement or "").strip()
- snippet = ""
- if announcement_html:
- snippet = f'\n
{announcement_html}
'
- html_content = html_content.replace("", snippet, 1)
- # Inject version
- html_content = html_content.replace("", __version__, 1)
- # Inject host
- html_content = html_content.replace("", settings.HOST_NAME, 1)
- return HTMLResponse(content=html_content, media_type="text/html")
- return HTMLResponse(
- content="Watchly API is running. Static files not found.",
- media_type="text/plain",
- status_code=200,
+async def configure_page(request: Request, _token: str | None = None):
+ languages = []
+ try:
+ languages = await fetch_languages_list()
+ except Exception as e:
+ logger.warning(f"Failed to fetch languages for template: {e}")
+ languages = [{"iso_639_1": "en-US", "language": "English", "country": "US"}]
+
+ template = jinja_env.get_template("index.html")
+ html_content = template.render(
+ request=request,
+ app_version=__version__,
+ app_host=settings.HOST_NAME,
+ announcement_html=settings.ANNOUNCEMENT_HTML or "",
+ languages=languages,
)
+ return HTMLResponse(content=html_content, media_type="text/html")
app.include_router(api_router)
diff --git a/app/core/config.py b/app/core/config.py
index e737ffc..98ccd23 100644
--- a/app/core/config.py
+++ b/app/core/config.py
@@ -45,5 +45,4 @@ class Settings(BaseSettings):
settings = Settings()
-# Get version from version.py (single source of truth)
APP_VERSION = __version__
diff --git a/app/core/constants.py b/app/core/constants.py
index e844b61..aec4c4f 100644
--- a/app/core/constants.py
+++ b/app/core/constants.py
@@ -1,6 +1,6 @@
RECOMMENDATIONS_CATALOG_NAME: str = "Top Picks For You"
-DEFAULT_MIN_ITEMS: int = 20
-DEFAULT_MAX_ITEMS: int = 32
+DEFAULT_MIN_ITEMS: int = 8
+DEFAULT_CATALOG_LIMIT = 20
DEFAULT_CONCURRENCY_LIMIT: int = 30
diff --git a/app/core/settings.py b/app/core/settings.py
index 76fd84e..c1ca9b6 100644
--- a/app/core/settings.py
+++ b/app/core/settings.py
@@ -7,8 +7,6 @@ class CatalogConfig(BaseModel):
enabled: bool = True
enabled_movie: bool = Field(default=True, description="Enable movie catalog for this configuration")
enabled_series: bool = Field(default=True, description="Enable series catalog for this configuration")
- min_items: int = Field(default=20, ge=1, le=20)
- max_items: int = Field(default=24, ge=1, le=32)
class UserSettings(BaseModel):
diff --git a/app/services/recommendation/catalog_service.py b/app/services/recommendation/catalog_service.py
index 86177a2..e942e97 100644
--- a/app/services/recommendation/catalog_service.py
+++ b/app/services/recommendation/catalog_service.py
@@ -4,9 +4,8 @@
from fastapi import HTTPException
from loguru import logger
-from app.api.endpoints.manifest import get_config_id
from app.core.config import settings
-from app.core.constants import DEFAULT_MAX_ITEMS, DEFAULT_MIN_ITEMS
+from app.core.constants import DEFAULT_CATALOG_LIMIT, DEFAULT_MIN_ITEMS
from app.core.settings import UserSettings, get_default_settings
from app.models.taste_profile import TasteProfile
from app.services.catalog_updater import catalog_updater
@@ -85,9 +84,6 @@ async def get_catalog(
)
whitelist = await integration_service.get_genre_whitelist(profile, content_type) if profile else set()
- # Get catalog limits
- min_items, max_items = self._get_catalog_limits(catalog_id, user_settings)
-
# Route to appropriate recommendation service
recommendations = await self._get_recommendations(
catalog_id=catalog_id,
@@ -98,16 +94,16 @@ async def get_catalog(
watched_imdb=watched_imdb,
whitelist=whitelist,
library_items=library_items,
- max_items=max_items,
+ limit=DEFAULT_CATALOG_LIMIT,
)
- # Pad if needed
- # TODO: This is risky because it can fetch too many unrelated items.
- if recommendations and len(recommendations) < PAD_RECOMMENDATIONS_THRESHOLD:
+ # Pad if needed to meet minimum of 8 items
+ # # TODO: This is risky because it can fetch too many unrelated items.
+ if recommendations and len(recommendations) < DEFAULT_MIN_ITEMS:
recommendations = await pad_to_min(
content_type,
recommendations,
- PAD_RECOMMENDATIONS_TARGET,
+ DEFAULT_MIN_ITEMS,
services["tmdb"],
user_settings,
watched_tmdb,
@@ -195,35 +191,6 @@ def _initialize_services(self, language: str, user_settings: UserSettings) -> di
"all_based": AllBasedService(tmdb_service, user_settings),
}
- def _get_catalog_limits(self, catalog_id: str, user_settings: UserSettings) -> tuple[int, int]:
- try:
- cfg_id = get_config_id({"id": catalog_id})
- except Exception:
- cfg_id = catalog_id
-
- try:
- cfg = next((c for c in user_settings.catalogs if c.id == cfg_id), None)
- if cfg and hasattr(cfg, "min_items") and hasattr(cfg, "max_items"):
- min_items = int(cfg.min_items or DEFAULT_MIN_ITEMS)
- max_items = int(cfg.max_items or DEFAULT_MAX_ITEMS)
- else:
- min_items, max_items = DEFAULT_MIN_ITEMS, DEFAULT_MAX_ITEMS
- except Exception:
- min_items, max_items = DEFAULT_MIN_ITEMS, DEFAULT_MAX_ITEMS
-
- # Enforce caps
- try:
- min_items = max(1, min(DEFAULT_MIN_ITEMS, int(min_items)))
- max_items = max(min_items, min(DEFAULT_MAX_ITEMS, int(max_items)))
- except (ValueError, TypeError):
- logger.warning(
- "Invalid min/max items values. Falling back to defaults. "
- f"min_items={min_items}, max_items={max_items}"
- )
- min_items, max_items = DEFAULT_MIN_ITEMS, DEFAULT_MAX_ITEMS
-
- return min_items, max_items
-
async def _get_recommendations(
self,
catalog_id: str,
@@ -234,7 +201,7 @@ async def _get_recommendations(
watched_imdb: set[str],
whitelist: set[int],
library_items: dict,
- max_items: int,
+ limit: int,
) -> list[dict[str, Any]]:
"""Route to appropriate recommendation service based on catalog ID."""
# Item-based recommendations
@@ -255,7 +222,7 @@ async def _get_recommendations(
content_type=content_type,
watched_tmdb=watched_tmdb,
watched_imdb=watched_imdb,
- limit=max_items,
+ limit=limit,
whitelist=whitelist,
)
logger.info(f"Found {len(recommendations)} recommendations for item {item_id}")
@@ -270,7 +237,7 @@ async def _get_recommendations(
profile=profile,
watched_tmdb=watched_tmdb,
watched_imdb=watched_imdb,
- limit=max_items,
+ limit=limit,
whitelist=whitelist,
)
logger.info(f"Found {len(recommendations)} recommendations for theme {catalog_id}")
@@ -285,7 +252,7 @@ async def _get_recommendations(
content_type=content_type,
watched_tmdb=watched_tmdb,
watched_imdb=watched_imdb,
- limit=max_items,
+ limit=limit,
)
else:
recommendations = []
@@ -302,7 +269,7 @@ async def _get_recommendations(
library_items=library_items,
watched_tmdb=watched_tmdb,
watched_imdb=watched_imdb,
- limit=max_items,
+ limit=limit,
)
else:
recommendations = []
@@ -318,7 +285,7 @@ async def _get_recommendations(
watched_tmdb=watched_tmdb,
watched_imdb=watched_imdb,
whitelist=whitelist,
- limit=max_items,
+ limit=limit,
item_type=item_type,
profile=profile,
)
diff --git a/app/static/index.html b/app/static/index.html
deleted file mode 100644
index afb24c7..0000000
--- a/app/static/index.html
+++ /dev/null
@@ -1,846 +0,0 @@
-
-
-
-
-
-
- Watchly - Personalized Stremio Recommendations
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- You're all set!
- Your personalized catalog is ready.
-
-
-
https://...
-
- Private Token - Do Not Share
-
-
-
-
- Install
- on App
- Install
- on Web
- Copy
- Link
-
- Start Over
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Confirm Action
-
Are you sure?
-
-
-
-
- Cancel
-
-
- Confirm
-
-
-
-
-
-
-
-
-
-
diff --git a/app/static/js/constants.js b/app/static/js/constants.js
new file mode 100644
index 0000000..1340d48
--- /dev/null
+++ b/app/static/js/constants.js
@@ -0,0 +1,19 @@
+// Default catalog configurations
+export const defaultCatalogs = [
+ { id: 'watchly.rec', name: 'Top Picks for You', enabled: true, enabledMovie: true, enabledSeries: true, description: 'Personalized recommendations based on your library' },
+ { id: 'watchly.loved', name: 'More Like', enabled: true, enabledMovie: true, enabledSeries: true, description: 'Recommendations similar to content you explicitly loved' },
+ { id: 'watchly.watched', name: 'Because You Watched', enabled: true, enabledMovie: true, enabledSeries: true, description: 'Recommendations based on your recent watch history' },
+ { id: 'watchly.creators', name: 'From your favourite Creators', enabled: false, enabledMovie: true, enabledSeries: true, description: 'Movies and series from your top 5 favorite directors and top 5 favorite actors' },
+ { id: 'watchly.all.loved', name: 'Based on what you loved', enabled: false, enabledMovie: true, enabledSeries: true, description: 'Recommendations based on all your loved items' },
+ { id: 'watchly.liked.all', name: 'Based on what you liked', enabled: false, enabledMovie: true, enabledSeries: true, description: 'Recommendations based on all your liked items' },
+ { id: 'watchly.theme', name: 'Genre & Keyword Catalogs', enabled: true, enabledMovie: true, enabledSeries: true, description: 'Dynamic catalogs based on your favorite genres, keyword, countries and many more. Just like netflix. Example: American Horror, Based on Novel or Book etc.' },
+];
+
+// Genre Constants
+export const MOVIE_GENRES = [
+ { id: '28', name: 'Action' }, { id: '12', name: 'Adventure' }, { id: '16', name: 'Animation' }, { id: '35', name: 'Comedy' }, { id: '80', name: 'Crime' }, { id: '99', name: 'Documentary' }, { id: '18', name: 'Drama' }, { id: '10751', name: 'Family' }, { id: '14', name: 'Fantasy' }, { id: '36', name: 'History' }, { id: '27', name: 'Horror' }, { id: '10402', name: 'Music' }, { id: '9648', name: 'Mystery' }, { id: '10749', name: 'Romance' }, { id: '878', name: 'Science Fiction' }, { id: '10770', name: 'TV Movie' }, { id: '53', name: 'Thriller' }, { id: '10752', name: 'War' }, { id: '37', name: 'Western' }
+];
+
+export const SERIES_GENRES = [
+ { id: '10759', name: 'Action & Adventure' }, { id: '16', name: 'Animation' }, { id: '35', name: 'Comedy' }, { id: '80', name: 'Crime' }, { id: '99', name: 'Documentary' }, { id: '18', name: 'Drama' }, { id: '10751', name: 'Family' }, { id: '10762', name: 'Kids' }, { id: '9648', name: 'Mystery' }, { id: '10763', name: 'News' }, { id: '10764', name: 'Reality' }, { id: '10765', name: 'Sci-Fi & Fantasy' }, { id: '10766', name: 'Soap' }, { id: '10767', name: 'Talk' }, { id: '10768', name: 'War & Politics' }, { id: '37', name: 'Western' }
+];
diff --git a/app/static/js/main.js b/app/static/js/main.js
new file mode 100644
index 0000000..d79b92a
--- /dev/null
+++ b/app/static/js/main.js
@@ -0,0 +1,180 @@
+// Main entry point - initializes all modules
+
+import { defaultCatalogs } from './constants.js';
+import { showToast, initializeFooter, initializeKofi } from './modules/ui.js';
+import { initializeNavigation, switchSection, lockNavigationForLoggedOut, initializeMobileNav, updateMobileLayout, unlockNavigation } from './modules/navigation.js';
+import { initializeAuth, setStremioLoggedOutState } from './modules/auth.js';
+import { initializeCatalogList, renderCatalogList, getCatalogs, setCatalogs } from './modules/catalog.js';
+import { initializeForm, clearErrors } from './modules/form.js';
+
+// Initialize catalogs state
+let catalogsState = JSON.parse(JSON.stringify(defaultCatalogs));
+
+// DOM Elements
+const configForm = document.getElementById('configForm');
+const catalogList = document.getElementById('catalogList');
+const movieGenreList = document.getElementById('movieGenreList');
+const seriesGenreList = document.getElementById('seriesGenreList');
+const submitBtn = document.getElementById('submitBtn');
+const stremioLoginBtn = document.getElementById('stremioLoginBtn');
+const stremioLoginText = document.getElementById('stremioLoginText');
+const emailInput = document.getElementById('emailInput');
+const passwordInput = document.getElementById('passwordInput');
+const emailPwdContinueBtn = document.getElementById('emailPwdContinueBtn');
+const languageSelect = document.getElementById('languageSelect');
+const configNextBtn = document.getElementById('configNextBtn');
+const catalogsNextBtn = document.getElementById('catalogsNextBtn');
+const successResetBtn = document.getElementById('successResetBtn');
+const btnGetStarted = document.getElementById('btn-get-started');
+
+const navItems = {
+ welcome: document.getElementById('nav-welcome'),
+ login: document.getElementById('nav-login'),
+ config: document.getElementById('nav-config'),
+ catalogs: document.getElementById('nav-catalogs'),
+ install: document.getElementById('nav-install')
+};
+
+const sections = {
+ welcome: document.getElementById('sect-welcome'),
+ login: document.getElementById('sect-login'),
+ config: document.getElementById('sect-config'),
+ catalogs: document.getElementById('sect-catalogs'),
+ install: document.getElementById('sect-install'),
+ success: document.getElementById('sect-success')
+};
+
+// Main scroll container
+const mainEl = document.querySelector('main');
+
+// Reset App Function
+function resetApp() {
+ if (configForm) configForm.reset();
+ clearErrors();
+
+ // Reset Navigation is now Back to Welcome
+ switchSection('welcome');
+
+ // Lock Navs
+ Object.keys(navItems).forEach(key => {
+ if (key !== 'login' && key !== 'welcome') {
+ if (navItems[key]) navItems[key].classList.add('disabled');
+ }
+ });
+
+ // Reset Stremio State
+ setStremioLoggedOutState();
+
+ // Reset catalogs
+ catalogsState = JSON.parse(JSON.stringify(defaultCatalogs));
+ setCatalogs(catalogsState);
+ renderCatalogList();
+
+ // Show Form
+ if (configForm) configForm.classList.remove('hidden');
+ if (sections.success) sections.success.classList.add('hidden');
+}
+
+// Welcome Flow Logic
+function initializeWelcomeFlow() {
+ if (!btnGetStarted) return;
+
+ // Support mobile taps reliably while avoiding double-fire (touch -> click)
+ let touched = false;
+ const handleGetStarted = (e) => {
+ if (e.type === 'click' && touched) return;
+ if (e.type === 'touchstart') touched = true;
+ if (navItems.login) navItems.login.classList.remove('disabled');
+ switchSection('login');
+ };
+
+ btnGetStarted.addEventListener('click', handleGetStarted);
+ btnGetStarted.addEventListener('touchstart', handleGetStarted, { passive: true });
+}
+
+// Initialize everything
+document.addEventListener('DOMContentLoaded', () => {
+ // Start at Welcome
+ switchSection('welcome');
+ initializeWelcomeFlow();
+
+ // Initialize all modules
+ initializeNavigation({
+ navItems,
+ sections,
+ mainEl
+ });
+
+ // By default, ensure logged-out users see only Welcome/Login
+ lockNavigationForLoggedOut();
+
+ // Initialize catalog management - set catalogs first
+ setCatalogs(catalogsState);
+ initializeCatalogList(
+ { catalogList },
+ {
+ catalogs: catalogsState,
+ renderCatalogList
+ }
+ );
+
+ // Initialize authentication
+ initializeAuth(
+ {
+ stremioLoginBtn,
+ stremioLoginText,
+ emailInput,
+ passwordInput,
+ emailPwdContinueBtn,
+ languageSelect
+ },
+ {
+ getCatalogs,
+ renderCatalogList,
+ resetApp
+ }
+ );
+
+ // Initialize form handling
+ initializeForm(
+ {
+ configForm,
+ submitBtn,
+ emailInput,
+ passwordInput,
+ languageSelect,
+ movieGenreList,
+ seriesGenreList
+ },
+ {
+ getCatalogs,
+ resetApp
+ }
+ );
+
+ // Initialize mobile navigation
+ initializeMobileNav();
+
+ // Initialize UI components
+ initializeFooter();
+ initializeKofi();
+
+ // Layout adjustments for fixed mobile header
+ updateMobileLayout();
+ window.addEventListener('resize', updateMobileLayout);
+ window.addEventListener('orientationchange', updateMobileLayout);
+
+ // Next Buttons
+ if (configNextBtn) configNextBtn.addEventListener('click', () => switchSection('catalogs'));
+ if (catalogsNextBtn) catalogsNextBtn.addEventListener('click', () => switchSection('install'));
+
+ // Reset Buttons
+ const resetBtn = document.getElementById('resetBtn');
+ if (resetBtn) resetBtn.addEventListener('click', resetApp);
+ if (successResetBtn) successResetBtn.addEventListener('click', resetApp);
+});
+
+// Make resetApp available globally for auth module
+window.resetApp = resetApp;
+window.switchSection = switchSection;
+window.unlockNavigation = unlockNavigation;
diff --git a/app/static/js/modules/auth.js b/app/static/js/modules/auth.js
new file mode 100644
index 0000000..a62d796
--- /dev/null
+++ b/app/static/js/modules/auth.js
@@ -0,0 +1,327 @@
+// Authentication Logic
+
+import { showToast } from './ui.js';
+import { switchSection, unlockNavigation, lockNavigationForLoggedOut } from './navigation.js';
+
+// DOM Elements - will be initialized
+let stremioLoginBtn = null;
+let stremioLoginText = null;
+let emailInput = null;
+let passwordInput = null;
+let emailPwdContinueBtn = null;
+let languageSelect = null;
+let getCatalogs = null;
+let renderCatalogList = null;
+let resetApp = null;
+
+export function initializeAuth(domElements, catalogState) {
+ stremioLoginBtn = domElements.stremioLoginBtn;
+ stremioLoginText = domElements.stremioLoginText;
+ emailInput = domElements.emailInput;
+ passwordInput = domElements.passwordInput;
+ emailPwdContinueBtn = domElements.emailPwdContinueBtn;
+ languageSelect = domElements.languageSelect;
+ getCatalogs = catalogState.getCatalogs;
+ renderCatalogList = catalogState.renderCatalogList;
+ resetApp = catalogState.resetApp;
+
+ initializeStremioLogin();
+ initializeEmailPasswordLogin();
+}
+
+// Stremio Login Logic
+async function initializeStremioLogin() {
+ const urlParams = new URLSearchParams(window.location.search);
+ const authKey = urlParams.get('key') || urlParams.get('authKey');
+
+ if (authKey) {
+ // Logged In -> Unlock and move to config
+ setStremioLoggedInState(authKey);
+
+ try {
+ await fetchStremioIdentity(authKey);
+ unlockNavigation();
+ switchSection('config');
+ } catch (error) {
+ showToast(error.message, "error");
+ if (resetApp) resetApp();
+ return;
+ }
+
+ // Remove query param
+ const newUrl = window.location.protocol + "//" + window.location.host + window.location.pathname;
+ window.history.replaceState({ path: newUrl }, '', newUrl);
+ }
+
+ if (stremioLoginBtn) {
+ stremioLoginBtn.addEventListener('click', () => {
+ if (stremioLoginBtn.getAttribute('data-action') === 'logout') {
+ if (resetApp) resetApp(); // Logout effectively resets the app flow
+ } else {
+ let appHost = window.APP_HOST;
+ if (!appHost || appHost.includes('
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ I'm building this addon alone in my free time. If you find Watchly useful, consider
+ supporting the project. Your support helps me keep it alive, maintain it, and continue improving it for
+ everyone.
+
+
+ Every contribution, no matter how small, makes a difference and fuels my passion to create
+ something amazing. I truly appreciate your support! 🙏
+
+
+
+
+
+
+
+
+
+
+ Fun fact: Momo is a delicious steamed spicy
+ dumpling popular in Nepal. Just like how momo brings joy to
+ food lovers, your support brings joy to this project! 🥟
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Confirm Action
+
Are you sure?
+
+
+
+
+ Cancel
+
+
+ Confirm
+
+
+
+
+
diff --git a/app/templates/components/section_catalogs.html b/app/templates/components/section_catalogs.html
new file mode 100644
index 0000000..c24b9ab
--- /dev/null
+++ b/app/templates/components/section_catalogs.html
@@ -0,0 +1,15 @@
+
+
+
+
Catalogs
+
Manage and organize your recommendation lists.
+
+
+
+ Reset Defaults
+ Next:
+ Install →
+
+
diff --git a/app/templates/components/section_config.html b/app/templates/components/section_config.html
new file mode 100644
index 0000000..0d5919c
--- /dev/null
+++ b/app/templates/components/section_config.html
@@ -0,0 +1,78 @@
+
+
+
+
Preferences
+
Customize how your recommendations appear.
+
+
+
+
+
Language
+
+
+ {% for lang in languages %}
+
+ {{ lang.language }} ({{ lang.country }})
+
+ {% endfor %}
+
+
+
+
+
+
+
+
+
+
+ Exclude Genres
+ Uncheck to include
+
+
+
+
+
+
+
+
+
RPDB API Key (Optional)
+
+
Enable ratings on posters via RatingPosterDB .
+
+
+ Next:
+ Catalogs →
+
+
diff --git a/app/templates/components/section_install.html b/app/templates/components/section_install.html
new file mode 100644
index 0000000..e14e46e
--- /dev/null
+++ b/app/templates/components/section_install.html
@@ -0,0 +1,95 @@
+
+
+
+
Save & Install
+
Ready to install your personalized addon.
+
+
+
+
+
+ Save & Install
+
+
+
+
+
+
+
+
+
+
+
+
Danger Zone
+
Permanently delete your settings and account
+ data. This action cannot be undone.
+
+
+
+
+
+ Delete Account
+
+
+
+
+
+
+
+
+
+
+
+
+
+ You're all set!
+ Your personalized catalog is ready.
+
+
+
https://...
+
+ Private Token - Do Not Share
+
+
+
+
+ Install
+ on App
+ Install
+ on Web
+ Copy
+ Link
+
+ Start Over
+
diff --git a/app/templates/components/section_login.html b/app/templates/components/section_login.html
new file mode 100644
index 0000000..99f45f7
--- /dev/null
+++ b/app/templates/components/section_login.html
@@ -0,0 +1,69 @@
+
+
+
+
Connect to Stremio
+
Log in to your Stremio account to enable Watchly to read your library.
+
+
+
+
+ Login with Stremio
+
+
+
+
+
+
+
+
+
+
Email
+
+
Password
+
+
+ Continue with Email
+
+
+
+
+
+
+
+
+
+
+
+ Why email & password?
+ We store your credentials securely to generate a fresh Stremio auth
+ key automatically when needed. This avoids expired keys and keeps your addon working
+ without manual re-login.
+ Prefer not to share your password? Use the Stremio login above to
+ supply an auth key. Note: auth keys can expire and may require periodic
+ re-authentication.
+
+
+
diff --git a/app/templates/components/section_welcome.html b/app/templates/components/section_welcome.html
new file mode 100644
index 0000000..f228054
--- /dev/null
+++ b/app/templates/components/section_welcome.html
@@ -0,0 +1,184 @@
+
+
+
+
+
+ Version {{ app_version }}
+
+
+
+
+
+
+
+
+
+ Watchly
+
+
+
+
+ Personalized Recommendation Engine for Stremio
+
+
+ Discover movies and series tailored to your unique taste, powered by your Stremio library
+ and watch history.
+
+
+ {% if announcement_html %}
+
+
+
{{ announcement_html|safe }}
+
+ {% endif %}
+
+
+
+
+
+
+
+
Smart Recommendations
+
+ AI-powered suggestions based on your watch history
+
+
+
+
+
+
+
Custom Catalogs
+
+ Organize with customizable names and order
+
+
+
+
+
+
+
Genre Filtering
+
+ Exclude genres you don't like
+
+
+
+
+
+
Multi-Language
+
+ Recommendations in your preferred language
+
+
+
+
+
+
+
RPDB Integration
+
+ Enhanced posters with ratings
+
+
+
+
+
+
+
Based on Your Loves
+
+ Recommendations from content you loved
+
+
+
+
+
+
+
+ Get Started
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/templates/components/sidebar.html b/app/templates/components/sidebar.html
new file mode 100644
index 0000000..2a224bc
--- /dev/null
+++ b/app/templates/components/sidebar.html
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
diff --git a/app/templates/index.html b/app/templates/index.html
new file mode 100644
index 0000000..fb9dd96
--- /dev/null
+++ b/app/templates/index.html
@@ -0,0 +1,23 @@
+{% extends "base.html" %}
+
+{% block content %}
+ {% include "components/sidebar.html" %}
+
+
+
+
+
+
+
+
+
+
+ {% include "components/modal_donation.html" %}
+{% endblock %}
diff --git a/pyproject.toml b/pyproject.toml
index 393e286..3ee1a78 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -20,6 +20,7 @@ dependencies = [
"redis>=5.0.1",
"tomli>=2.3.0",
"uvicorn[standard]>=0.24.0",
+ "jinja2>=3.1.6",
]
[tool.setuptools.dynamic]
diff --git a/requirements.txt b/requirements.txt
index ea81f38..c5b0f49 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -14,8 +14,6 @@ apscheduler==3.11.2
# via watchly (pyproject.toml)
async-lru==2.0.5
# via watchly (pyproject.toml)
-async-timeout==5.0.1
- # via redis
beautifulsoup4==4.14.3
# via deep-translator
cachetools==6.2.4
@@ -39,8 +37,6 @@ deep-translator==1.11.4
# via watchly (pyproject.toml)
distro==1.9.0
# via google-genai
-exceptiongroup==1.3.1
- # via anyio
fastapi==0.127.0
# via watchly (pyproject.toml)
google-auth==2.45.0
@@ -70,8 +66,12 @@ idna==3.11
# anyio
# httpx
# requests
+jinja2==3.1.6
+ # via watchly (pyproject.toml)
loguru==0.7.3
# via watchly (pyproject.toml)
+markupsafe==3.0.3
+ # via jinja2
pyasn1==0.6.1
# via
# pyasn1-modules
@@ -119,18 +119,12 @@ tomli==2.3.0
# via watchly (pyproject.toml)
typing-extensions==4.15.0
# via
- # anyio
- # async-lru
# beautifulsoup4
- # cryptography
- # exceptiongroup
# fastapi
# google-genai
# pydantic
# pydantic-core
- # starlette
# typing-inspection
- # uvicorn
typing-inspection==0.4.2
# via
# pydantic
diff --git a/uv.lock b/uv.lock
index 6839877..6971df5 100644
--- a/uv.lock
+++ b/uv.lock
@@ -533,6 +533,18 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" },
]
+[[package]]
+name = "jinja2"
+version = "3.1.6"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "markupsafe" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" },
+]
+
[[package]]
name = "loguru"
version = "0.7.3"
@@ -546,6 +558,69 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/0c/29/0348de65b8cc732daa3e33e67806420b2ae89bdce2b04af740289c5c6c8c/loguru-0.7.3-py3-none-any.whl", hash = "sha256:31a33c10c8e1e10422bfd431aeb5d351c7cf7fa671e3c4df004162264b28220c", size = 61595, upload-time = "2024-12-06T11:20:54.538Z" },
]
+[[package]]
+name = "markupsafe"
+version = "3.0.3"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" },
+ { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" },
+ { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" },
+ { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload-time = "2025-09-27T18:36:33.86Z" },
+ { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload-time = "2025-09-27T18:36:35.099Z" },
+ { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload-time = "2025-09-27T18:36:36.001Z" },
+ { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload-time = "2025-09-27T18:36:36.906Z" },
+ { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload-time = "2025-09-27T18:36:37.868Z" },
+ { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload-time = "2025-09-27T18:36:38.761Z" },
+ { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload-time = "2025-09-27T18:36:39.701Z" },
+ { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload-time = "2025-09-27T18:36:40.689Z" },
+ { url = "https://files.pythonhosted.org/packages/38/2f/907b9c7bbba283e68f20259574b13d005c121a0fa4c175f9bed27c4597ff/markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795", size = 11622, upload-time = "2025-09-27T18:36:41.777Z" },
+ { url = "https://files.pythonhosted.org/packages/9c/d9/5f7756922cdd676869eca1c4e3c0cd0df60ed30199ffd775e319089cb3ed/markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219", size = 12029, upload-time = "2025-09-27T18:36:43.257Z" },
+ { url = "https://files.pythonhosted.org/packages/00/07/575a68c754943058c78f30db02ee03a64b3c638586fba6a6dd56830b30a3/markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6", size = 24374, upload-time = "2025-09-27T18:36:44.508Z" },
+ { url = "https://files.pythonhosted.org/packages/a9/21/9b05698b46f218fc0e118e1f8168395c65c8a2c750ae2bab54fc4bd4e0e8/markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676", size = 22980, upload-time = "2025-09-27T18:36:45.385Z" },
+ { url = "https://files.pythonhosted.org/packages/7f/71/544260864f893f18b6827315b988c146b559391e6e7e8f7252839b1b846a/markupsafe-3.0.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9", size = 21990, upload-time = "2025-09-27T18:36:46.916Z" },
+ { url = "https://files.pythonhosted.org/packages/c2/28/b50fc2f74d1ad761af2f5dcce7492648b983d00a65b8c0e0cb457c82ebbe/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1", size = 23784, upload-time = "2025-09-27T18:36:47.884Z" },
+ { url = "https://files.pythonhosted.org/packages/ed/76/104b2aa106a208da8b17a2fb72e033a5a9d7073c68f7e508b94916ed47a9/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc", size = 21588, upload-time = "2025-09-27T18:36:48.82Z" },
+ { url = "https://files.pythonhosted.org/packages/b5/99/16a5eb2d140087ebd97180d95249b00a03aa87e29cc224056274f2e45fd6/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12", size = 23041, upload-time = "2025-09-27T18:36:49.797Z" },
+ { url = "https://files.pythonhosted.org/packages/19/bc/e7140ed90c5d61d77cea142eed9f9c303f4c4806f60a1044c13e3f1471d0/markupsafe-3.0.3-cp313-cp313-win32.whl", hash = "sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed", size = 14543, upload-time = "2025-09-27T18:36:51.584Z" },
+ { url = "https://files.pythonhosted.org/packages/05/73/c4abe620b841b6b791f2edc248f556900667a5a1cf023a6646967ae98335/markupsafe-3.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5", size = 15113, upload-time = "2025-09-27T18:36:52.537Z" },
+ { url = "https://files.pythonhosted.org/packages/f0/3a/fa34a0f7cfef23cf9500d68cb7c32dd64ffd58a12b09225fb03dd37d5b80/markupsafe-3.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485", size = 13911, upload-time = "2025-09-27T18:36:53.513Z" },
+ { url = "https://files.pythonhosted.org/packages/e4/d7/e05cd7efe43a88a17a37b3ae96e79a19e846f3f456fe79c57ca61356ef01/markupsafe-3.0.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73", size = 11658, upload-time = "2025-09-27T18:36:54.819Z" },
+ { url = "https://files.pythonhosted.org/packages/99/9e/e412117548182ce2148bdeacdda3bb494260c0b0184360fe0d56389b523b/markupsafe-3.0.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37", size = 12066, upload-time = "2025-09-27T18:36:55.714Z" },
+ { url = "https://files.pythonhosted.org/packages/bc/e6/fa0ffcda717ef64a5108eaa7b4f5ed28d56122c9a6d70ab8b72f9f715c80/markupsafe-3.0.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19", size = 25639, upload-time = "2025-09-27T18:36:56.908Z" },
+ { url = "https://files.pythonhosted.org/packages/96/ec/2102e881fe9d25fc16cb4b25d5f5cde50970967ffa5dddafdb771237062d/markupsafe-3.0.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025", size = 23569, upload-time = "2025-09-27T18:36:57.913Z" },
+ { url = "https://files.pythonhosted.org/packages/4b/30/6f2fce1f1f205fc9323255b216ca8a235b15860c34b6798f810f05828e32/markupsafe-3.0.3-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6", size = 23284, upload-time = "2025-09-27T18:36:58.833Z" },
+ { url = "https://files.pythonhosted.org/packages/58/47/4a0ccea4ab9f5dcb6f79c0236d954acb382202721e704223a8aafa38b5c8/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f", size = 24801, upload-time = "2025-09-27T18:36:59.739Z" },
+ { url = "https://files.pythonhosted.org/packages/6a/70/3780e9b72180b6fecb83a4814d84c3bf4b4ae4bf0b19c27196104149734c/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb", size = 22769, upload-time = "2025-09-27T18:37:00.719Z" },
+ { url = "https://files.pythonhosted.org/packages/98/c5/c03c7f4125180fc215220c035beac6b9cb684bc7a067c84fc69414d315f5/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009", size = 23642, upload-time = "2025-09-27T18:37:01.673Z" },
+ { url = "https://files.pythonhosted.org/packages/80/d6/2d1b89f6ca4bff1036499b1e29a1d02d282259f3681540e16563f27ebc23/markupsafe-3.0.3-cp313-cp313t-win32.whl", hash = "sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354", size = 14612, upload-time = "2025-09-27T18:37:02.639Z" },
+ { url = "https://files.pythonhosted.org/packages/2b/98/e48a4bfba0a0ffcf9925fe2d69240bfaa19c6f7507b8cd09c70684a53c1e/markupsafe-3.0.3-cp313-cp313t-win_amd64.whl", hash = "sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218", size = 15200, upload-time = "2025-09-27T18:37:03.582Z" },
+ { url = "https://files.pythonhosted.org/packages/0e/72/e3cc540f351f316e9ed0f092757459afbc595824ca724cbc5a5d4263713f/markupsafe-3.0.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287", size = 13973, upload-time = "2025-09-27T18:37:04.929Z" },
+ { url = "https://files.pythonhosted.org/packages/33/8a/8e42d4838cd89b7dde187011e97fe6c3af66d8c044997d2183fbd6d31352/markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe", size = 11619, upload-time = "2025-09-27T18:37:06.342Z" },
+ { url = "https://files.pythonhosted.org/packages/b5/64/7660f8a4a8e53c924d0fa05dc3a55c9cee10bbd82b11c5afb27d44b096ce/markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026", size = 12029, upload-time = "2025-09-27T18:37:07.213Z" },
+ { url = "https://files.pythonhosted.org/packages/da/ef/e648bfd021127bef5fa12e1720ffed0c6cbb8310c8d9bea7266337ff06de/markupsafe-3.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737", size = 24408, upload-time = "2025-09-27T18:37:09.572Z" },
+ { url = "https://files.pythonhosted.org/packages/41/3c/a36c2450754618e62008bf7435ccb0f88053e07592e6028a34776213d877/markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97", size = 23005, upload-time = "2025-09-27T18:37:10.58Z" },
+ { url = "https://files.pythonhosted.org/packages/bc/20/b7fdf89a8456b099837cd1dc21974632a02a999ec9bf7ca3e490aacd98e7/markupsafe-3.0.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d", size = 22048, upload-time = "2025-09-27T18:37:11.547Z" },
+ { url = "https://files.pythonhosted.org/packages/9a/a7/591f592afdc734f47db08a75793a55d7fbcc6902a723ae4cfbab61010cc5/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda", size = 23821, upload-time = "2025-09-27T18:37:12.48Z" },
+ { url = "https://files.pythonhosted.org/packages/7d/33/45b24e4f44195b26521bc6f1a82197118f74df348556594bd2262bda1038/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf", size = 21606, upload-time = "2025-09-27T18:37:13.485Z" },
+ { url = "https://files.pythonhosted.org/packages/ff/0e/53dfaca23a69fbfbbf17a4b64072090e70717344c52eaaaa9c5ddff1e5f0/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe", size = 23043, upload-time = "2025-09-27T18:37:14.408Z" },
+ { url = "https://files.pythonhosted.org/packages/46/11/f333a06fc16236d5238bfe74daccbca41459dcd8d1fa952e8fbd5dccfb70/markupsafe-3.0.3-cp314-cp314-win32.whl", hash = "sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9", size = 14747, upload-time = "2025-09-27T18:37:15.36Z" },
+ { url = "https://files.pythonhosted.org/packages/28/52/182836104b33b444e400b14f797212f720cbc9ed6ba34c800639d154e821/markupsafe-3.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581", size = 15341, upload-time = "2025-09-27T18:37:16.496Z" },
+ { url = "https://files.pythonhosted.org/packages/6f/18/acf23e91bd94fd7b3031558b1f013adfa21a8e407a3fdb32745538730382/markupsafe-3.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4", size = 14073, upload-time = "2025-09-27T18:37:17.476Z" },
+ { url = "https://files.pythonhosted.org/packages/3c/f0/57689aa4076e1b43b15fdfa646b04653969d50cf30c32a102762be2485da/markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab", size = 11661, upload-time = "2025-09-27T18:37:18.453Z" },
+ { url = "https://files.pythonhosted.org/packages/89/c3/2e67a7ca217c6912985ec766c6393b636fb0c2344443ff9d91404dc4c79f/markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175", size = 12069, upload-time = "2025-09-27T18:37:19.332Z" },
+ { url = "https://files.pythonhosted.org/packages/f0/00/be561dce4e6ca66b15276e184ce4b8aec61fe83662cce2f7d72bd3249d28/markupsafe-3.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634", size = 25670, upload-time = "2025-09-27T18:37:20.245Z" },
+ { url = "https://files.pythonhosted.org/packages/50/09/c419f6f5a92e5fadde27efd190eca90f05e1261b10dbd8cbcb39cd8ea1dc/markupsafe-3.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50", size = 23598, upload-time = "2025-09-27T18:37:21.177Z" },
+ { url = "https://files.pythonhosted.org/packages/22/44/a0681611106e0b2921b3033fc19bc53323e0b50bc70cffdd19f7d679bb66/markupsafe-3.0.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e", size = 23261, upload-time = "2025-09-27T18:37:22.167Z" },
+ { url = "https://files.pythonhosted.org/packages/5f/57/1b0b3f100259dc9fffe780cfb60d4be71375510e435efec3d116b6436d43/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5", size = 24835, upload-time = "2025-09-27T18:37:23.296Z" },
+ { url = "https://files.pythonhosted.org/packages/26/6a/4bf6d0c97c4920f1597cc14dd720705eca0bf7c787aebc6bb4d1bead5388/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523", size = 22733, upload-time = "2025-09-27T18:37:24.237Z" },
+ { url = "https://files.pythonhosted.org/packages/14/c7/ca723101509b518797fedc2fdf79ba57f886b4aca8a7d31857ba3ee8281f/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc", size = 23672, upload-time = "2025-09-27T18:37:25.271Z" },
+ { url = "https://files.pythonhosted.org/packages/fb/df/5bd7a48c256faecd1d36edc13133e51397e41b73bb77e1a69deab746ebac/markupsafe-3.0.3-cp314-cp314t-win32.whl", hash = "sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d", size = 14819, upload-time = "2025-09-27T18:37:26.285Z" },
+ { url = "https://files.pythonhosted.org/packages/1a/8a/0402ba61a2f16038b48b39bccca271134be00c5c9f0f623208399333c448/markupsafe-3.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9", size = 15426, upload-time = "2025-09-27T18:37:27.316Z" },
+ { url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" },
+]
+
[[package]]
name = "mccabe"
version = "0.6.1"
@@ -1148,6 +1223,7 @@ dependencies = [
{ name = "fastapi" },
{ name = "google-genai" },
{ name = "httpx", extra = ["http2"] },
+ { name = "jinja2" },
{ name = "loguru" },
{ name = "pydantic" },
{ name = "pydantic-core" },
@@ -1174,6 +1250,7 @@ requires-dist = [
{ name = "fastapi", specifier = ">=0.104.1" },
{ name = "google-genai", specifier = ">=1.54.0" },
{ name = "httpx", extras = ["http2"], specifier = ">=0.25.2" },
+ { name = "jinja2", specifier = ">=3.1.6" },
{ name = "loguru", specifier = ">=0.7.2" },
{ name = "pydantic", specifier = ">=2.5.0" },
{ name = "pydantic-core", specifier = ">=2.41.5" },