Skip to main content

HVBrowser

HVBrowser provides browser automation APIs for HentaiVerse. It builds on hbrowser for the shared authenticated browser session.

The package was extracted from the historical combined hbrowser distribution. Battle-domain APIs live in the separate hvbattle package. HVBrowser 0.1.7 requires hbrowser>=0.36.0,<0.37. HBrowser 0.36 separates FlareSolverr session recovery from main-browser and network-route lifecycle; it also removes the former proxy-rotator driver API.

HVDriver.get_level() reads the visible character level from the current HentaiVerse page. A missing or malformed readout raises instead of inventing a level, allowing application-owned daily challenge caches to invalidate safely when a character levels up.

Lottery and Monster Lab APIs

Lottery inspection is read-only and returns the current ticket count, shared GP balance, and the fixed 1,000 GP ticket price. Purchasing requires an explicit lottery kind and positive quantity, then verifies the exact ticket increase and GP decrease before returning:

from hvbrowser import LotteryClient, LotteryKind

client = LotteryClient(driver)
snapshot = await client.inspect(LotteryKind.WEAPON)
report = await client.purchase(
    LotteryKind.WEAPON,
    25,
    expected_before=snapshot,
)

The optional snapshot is an optimistic precondition: if tickets, GP, lottery kind, or price changed after planning, the client raises before touching the purchase form.

Target counts, Weapon-versus-Armor priority, and behavior when GP is limited are application policy and intentionally do not belong in this package. The legacy HVDriver.loetterycheck() spelling remains as a compatibility wrapper.

Monster Lab exposes the two known feed-all resources explicitly:

from hvbrowser import MonsterLabClient, MonsterLabFeed

client = MonsterLabClient(driver)
snapshot = await client.inspect()
food_report = await client.feed_all(MonsterLabFeed.FOOD)
drugs_report = await client.feed_all(MonsterLabFeed.DRUGS)

After the Monster Lab API is confirmed, an action image that is not present is reported as unavailable and produces no mutation. The selector and post-submission disappearance semantics still require a read-only live selector check and a separately authorized mutation check, respectively. Missing page structure, unknown submission outcomes, and unstable/failed post-submit confirmation raise typed errors. Both purchase and feed-all calls change account state; automated package tests use only offline fakes.

Lottery, Monster Lab, and Repair navigation share a fail-closed maintenance guard. One atomic DOM snapshot classifies timed challenge, final-completion, next-floor, and active-battle markers. Any such marker raises MaintenanceNavigationBlockedError before Bazaar interaction; its typed blocker field is a MaintenanceNavigationBlocker value. A Persistent post-battle client is allowed one initial navigation away from its own positively completed battle; the landing page is classified before any Bazaar interaction. Every retry and Repair navigation classifies the current page first, and every navigation is classified again after it completes.

When no battle marker is present, a Bazaar selector timeout or missing element allows exactly one same-realm homepage retry. A second miss fails, and non-timeout errors are never retried. No Lottery purchase or Monster Lab submission is attempted during this navigation recovery. Repair captures the current realm before its fallback and reloads only that realm: Isekai uses goisekai(), while Persistent uses gohomepage(force=True).

Development

Build a clean environment backed by the PyPI release of hbrowser:

bash scripts/rebuild-env.sh

For coordinated local development, overlay the clean environment manually:

uv pip install --python .venv/bin/python --reinstall --no-deps --editable \
  /Users/kuanlun_wang/Desktop/git-repo/hbrowser.clone

Commands that must preserve this editable overlay use uv run --no-sync.

Read-only Market inspection

Market inspection and sale planning are non-mutating by default:

import asyncio

from hvbrowser import HVDriver, SellItems


async def main() -> None:
    async with HVDriver(headless=True) as driver:
        snapshot = await driver.inspect_market()
        plan = await driver.marketcheck(SellItems(materials=["Low-Grade Metals"]))
        print(len(snapshot.items), plan.total_units)


asyncio.run(main())

The compatibility marketcheck() call requires commit=True before it can request submission. Submission is currently blocked by a fail-closed runtime gate until the current quote selector and pricing semantics have been confirmed with the read-only live probe. The guarded implementation never deposits credits and never re-lists unrelated orders.

Guarded live smoke test

The surrounding hentaiverse workspace owns account selection. This smoke probe only refuses to construct a browser unless credentials are supplied indirectly through the environment. It stops when an active battle is detected and contains no state-changing purchase, feed-all, submit, repair, recovery, or battle call. It does use navigation clicks to reach the requested read-only pages:

uv run --no-sync python scripts/live_readonly_smoke.py \
  --skip-market \
  --inspect-lotteries \
  --inspect-monster-lab

--skip-market lets the two new selectors be checked independently while the Market integration is unavailable. The last two flags only inspect counts and action availability. They never call the Lottery purchase form or do_feed_all. When the current realm is Isekai, Lottery and Monster Lab are reported as unavailable and skipped without navigating to Persistent.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hvbrowser-0.1.11.tar.gz (42.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hvbrowser-0.1.11-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

Details for the file hvbrowser-0.1.11.tar.gz.

File metadata

  • Download URL: hvbrowser-0.1.11.tar.gz
  • Upload date:
  • Size: 42.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hvbrowser-0.1.11.tar.gz
Algorithm Hash digest
SHA256 6975b1f9fbb846a798f9863f7579a8833d28b937c261548453efc8a2c4244717
MD5 f5d610ca2901cd77627eaf7f6f77b415
BLAKE2b-256 ec311b78afd6335bf24546ce4015588e3d570fb72d6b1090ab491adae00a18ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for hvbrowser-0.1.11.tar.gz:

Publisher: publish.yml on Kuan-Lun/hvbrowser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hvbrowser-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: hvbrowser-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 34.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hvbrowser-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 bdba02a8164804ee195e181ab7e8442599e2967ddfa83474ff1e2ed882d0b2cb
MD5 c011137dae3be1391f336881a8e000c0
BLAKE2b-256 14915e877f545bf7628818920dc48626fc5fb13054bc7b2479fe2af614d68402

See more details on using hashes here.

Provenance

The following attestation bundles were made for hvbrowser-0.1.11-py3-none-any.whl:

Publisher: publish.yml on Kuan-Lun/hvbrowser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.10.2

2 files

0.10.1

2 files

0.9.8

2 files

0.9.7

2 files

0.9.6

2 files

0.9.5

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.8.0

2 files

0.7.3

2 files

0.7.2

2 files

0.7.0

2 files

0.6.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.13

2 files

0.2.12

2 files

0.2.11

2 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

This release

0.1.11 This release

2 files

0.1.10

2 files

0.1.9

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page