diff --git a/sijapi/routers/archivist.py b/sijapi/routers/archivist.py index 71075b8..fff4ea5 100644 --- a/sijapi/routers/archivist.py +++ b/sijapi/routers/archivist.py @@ -29,9 +29,8 @@ from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry from datetime import datetime as dt_datetime from better_profanity import profanity -from sijapi.classes import L, API, Archivist from sijapi.utilities import html_to_markdown, sanitize_filename, assemble_journal_path, assemble_archive_path, contains_profanity, is_ad_or_tracker, initialize_adblock_rules, contains_blacklisted_word -from sijapi import L, Archivist, BLOCKLISTS_DIR, OBSIDIAN_VAULT_DIR, OBSIDIAN_RESOURCES_DIR, DEFAULT_11L_VOICE, DEFAULT_VOICE +from sijapi import L, API, Archivist, BLOCKLISTS_DIR, OBSIDIAN_VAULT_DIR, OBSIDIAN_RESOURCES_DIR, DEFAULT_11L_VOICE, DEFAULT_VOICE archivist = APIRouter() diff --git a/sijapi/routers/news.py b/sijapi/routers/news.py index cfc8553..6bcdc1b 100644 --- a/sijapi/routers/news.py +++ b/sijapi/routers/news.py @@ -25,7 +25,7 @@ from urllib3.util.retry import Retry from fastapi import APIRouter, BackgroundTasks, UploadFile, Form, HTTPException, Query, Path as FastAPIPath from pathlib import Path from sijapi import L, News, Archivist, OBSIDIAN_VAULT_DIR, OBSIDIAN_RESOURCES_DIR, DEFAULT_11L_VOICE, DEFAULT_VOICE -from sijapi.utilities import htmp_to_markdown, sanitize_filename, assemble_journal_path, assemble_archive_path, contains_profanity, is_ad_or_tracker +from sijapi.utilities import html_to_markdown, sanitize_filename, assemble_journal_path, assemble_archive_path, contains_profanity, is_ad_or_tracker from sijapi.routers import gis, llm, tts, note news = APIRouter() diff --git a/sijapi/utilities.py b/sijapi/utilities.py index 86fe004..367a477 100644 --- a/sijapi/utilities.py +++ b/sijapi/utilities.py @@ -27,6 +27,7 @@ from scipy.spatial import cKDTree from dateutil.parser import parse as dateutil_parse from docx import Document from sshtunnel import SSHTunnelForwarder +from urllib.parse import urlparse from fastapi import Depends, HTTPException, Request, UploadFile from fastapi.security.api_key import APIKeyHeader @@ -215,15 +216,15 @@ def load_filter_lists(blocklists_dir: Path): try: with open(file_path, 'r', encoding='utf-8') as file: rules.extend(file.read().splitlines()) - logging.info(f"Loaded blocklist: {file_path.name}") + info(f"Loaded blocklist: {file_path.name}") except Exception as e: - logging.error(f"Error loading blocklist {file_path.name}: {str(e)}") + err(f"Error loading blocklist {file_path.name}: {str(e)}") return rules def initialize_adblock_rules(blocklists_dir: Path): rules = load_filter_lists(blocklists_dir) - logging.info(f"Initialized AdblockRules with {len(rules)} rules") + info(f"Initialized AdblockRules with {len(rules)} rules") return AdblockRules(rules)