NanmiCoder/MediaCrawler · error · IpGetError

unkown err

Error message

unkown err

What it means

IpGetError raised by JiSuHttpProxy.get_proxy_ip when the JiSu HTTP API responds with a result code indicating failure and the message is missing or unrecognized ('unkown err' is the fallback for an absent msg field). The exception comes from proxy/base_proxy.py and aborts proxy acquisition for the jishu provider.

Source

Thrown at proxy/providers/jishu_http_proxy.py:95

            })
            res_dict: Dict = response.json()
            if res_dict.get("code") == 0:
                data: List[Dict] = res_dict.get("data")
                current_ts = utils.get_unix_timestamp()
                for ip_item in data:
                    ip_info_model = IpInfoModel(
                        ip=ip_item.get("ip"),
                        port=ip_item.get("port"),
                        user=ip_item.get("user"),
                        password=ip_item.get("pass"),
                        expired_time_ts=utils.get_unix_time_from_time_str(ip_item.get("expire")),
                    )
                    ip_key = f"JISUHTTP_{ip_info_model.ip}_{ip_info_model.port}_{ip_info_model.user}_{ip_info_model.password}"
                    ip_value = ip_info_model.json()
                    ip_infos.append(ip_info_model)
                    self.ip_cache.set_ip(ip_key, ip_value, ex=ip_info_model.expired_time_ts - current_ts)
            else:
                raise IpGetError(res_dict.get("msg", "unkown err"))
        return ip_cache_list + ip_infos


def new_jisu_http_proxy() -> JiSuHttpProxy:
    """
    Construct JiSu HTTP instance
    Returns:

    """
    return JiSuHttpProxy(
        key=os.getenv("jisu_key", ""),  # Get JiSu HTTP IP extraction key value through environment variable
        crypto=os.getenv("jisu_crypto", ""),  # Get JiSu HTTP IP extraction encryption signature through environment variable
        time_validity_period=30  # 30 minutes (maximum validity)
    )

View on GitHub (pinned to d6f7c5bb90)

Solutions

  1. Set the JISU_HTTP env vars: export jisu_key=... and jisu_crypto=... before running (they are read via os.getenv with empty defaults).
  2. Check the jisu account balance/quota and that the key is active.
  3. Log the full res_dict (excluding secrets) to see the real code when msg is missing.
  4. If the API contract changed, update the URL/params/parsing in proxy/providers/jishu_http_proxy.py to match current jisu docs.

Example fix

# before
# run without env vars -> res_dict has error, no msg -> 'unkown err'
python main.py --platform xhs --type search
# after
export jisu_key="your_key" jisu_crypto="your_crypto"
python main.py --platform xhs --type search
Defensive patterns

Strategy: validation

Validate before calling

import os
def jisu_env_is_set() -> bool:
    return bool(os.getenv("jisu_key")) and bool(os.getenv("jisu_crypto"))

Try / catch

from proxy.base_proxy import IpGetError
try:
    proxies = await jisu_proxy.get_proxy_ip()
except IpGetError as e:
    if str(e) == "unkown err":
        raise RuntimeError("jisu proxy API failed without msg - check jisu_key/jisu_crypto and account balance") from e
    raise

Prevention

When it happens

Trigger: Calling the jisu proxy API with a missing/wrong jisu_key or jisu_crypto env var, an expired balance/plan, a rate limit on IP extraction, or a changed API contract so the expected fields are absent - res_dict carries no usable msg.

Common situations: jisu_key/jisu_crypto environment variables never set (they default to empty strings); jisu subscription exhausted; upstream response schema changed; calling get_proxy_ip more often than the plan allows.

Related errors


AI-assisted analysis of NanmiCoder/MediaCrawler@d6f7c5bb90 (2026-08-15). Data as JSON: /api/errors/f967b6a85e1f9769. Report an issue: GitHub.