17 lines
473 B
Python
17 lines
473 B
Python
"""
|
||
PDF 转 Markdown 微服务的 HTTP 地址(仅此一处拼 URL,不 import configs,避免旧 .pyc / 错误包名导致仍用 0.0.0.0)。
|
||
"""
|
||
from __future__ import annotations
|
||
|
||
import os
|
||
|
||
_DEFAULT = "http://127.0.0.1:6006/convert/"
|
||
|
||
|
||
def resolve_pdf_convert_post_url() -> str:
|
||
u = (os.environ.get("PDF_CONVERT_API_URL") or "").strip() or _DEFAULT
|
||
u = u.replace("0.0.0.0", "127.0.0.1")
|
||
if not u.startswith("http"):
|
||
return _DEFAULT
|
||
return u
|