INNER CODE UNIT · Python

fetch_form

witchan/ios-mcp · scripts/submit_bigboss_update.py:63

def fetch_form(url: str, timeout: float) -> tuple[str, dict[str, str]]:
    request = Request(url, headers={"User-Agent": "ios-mcp-bigboss-update/1.1"})
    with urlopen(request, timeout=timeout) as response:
        html = response.read().decode("utf-8", "replace")

    parser = CFormsParser(FORM_ID)
    parser.feed(html)
    if not parser.form_seen:
        raise RuntimeError(f"BigBoss update form {FORM_ID} was not found")
    if parser.method != "post":
        raise RuntimeError(f"Unexpected BigBoss form method: {parser.method}")

    action = strip_fragment(urljoin(url, parser.action or url))
    return action, parser.hidden_fields


def read_changes(args: argparse.Namespace) -> str:
    if args.changes is not None:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…