Skip to main content

CLI reader for 4D4Y/HiPDA Discovery forum posts.

Project description

hipda

Local-first CLI for the 4D4Y/HiPDA Discovery channel (fid=2). Threads and posts are mirrored into a local SQLite store with FTS5 + jieba so listing, reading, and searching all work offline once the cache is warm.

Install + log in

The site uses browser/session checks, so direct unauthenticated requests may return a Cloudflare challenge. Log in once through Chrome:

uvx --from . hipda login

From PyPI:

uvx hipda login

That opens 4D4Y in Google Chrome. After you finish logging in, return to the terminal and press Enter.

The cookie is stored at ~/.config/hipda/cookie and the user agent is stored at ~/.config/hipda/user-agent, both with 0600 permissions. You can override them per command with HIPDA_COOKIE / --cookie and HIPDA_USER_AGENT / --user-agent.

Sync the local store

uvx --from . hipda sync                  # walk recent Discovery pages, stop when a page brings no changes
uvx --from . hipda sync --max-pages 10   # walk up to 10 pages
uvx --from . hipda sync --no-early-stop  # always walk the full --max-pages range

Sync writes to the SQLite database at $HIPDA_DB, or $XDG_DATA_HOME/hipda/hipda.sqlite, falling back to ~/.local/share/hipda/hipda.sqlite.

List threads (local-first)

uvx --from . hipda list --limit 20            # reads local DB; auto-syncs when cold
uvx --from . hipda list --refresh             # sync first, then print
uvx --from . hipda list --offline             # never touch the network
uvx --from . hipda list --show-pinned         # include pinned threads
uvx --from . hipda list --json                # machine-readable output

Read a thread (local-first)

uvx --from . hipda read 3446553               # reads local; auto-fetches the thread when cold
uvx --from . hipda read 3446553 --refresh     # re-sync the thread before printing
uvx --from . hipda read 3446553 --offline     # local only
uvx --from . hipda read 3446553 --json        # JSON array of posts

Full-text search

Search runs entirely against the local SQLite FTS5 index. Queries are segmented with jieba so CJK input works without spaces.

uvx --from . hipda search "半导体"
uvx --from . hipda search "半导体" --scope threads     # only thread titles
uvx --from . hipda search "半导体" --scope posts       # only post bodies
uvx --from . hipda search "半导体" --json --limit 50   # machine-readable

Each hit returns the matching tid (and pid for post matches), the thread title, and a snippet with [...] brackets around the matched tokens.

Exit codes

  • 0 — success
  • 1 — generic failure (e.g. parse error, thread not found upstream)
  • 2 — auth required (run hipda login)
  • 4--offline requested but the local store is missing the needed data

TLS

The CLI disables HTTPS certificate verification by default because 4D4Y often fails from Python environments where Chrome still works. To verify certificates, pass a trusted root certificate and --verify-tls:

uvx --from . hipda --verify-tls --ca-file /path/to/root-ca.pem sync

Legacy

hipda list previously fetched directly from the forum on every call. The behaviour is now local-first; the old hipda discovery list and hipda discovery read subcommands still resolve through the same local-first path.

Project details


Download files

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

Source Distribution

hipda-0.2.1.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

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

hipda-0.2.1-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file hipda-0.2.1.tar.gz.

File metadata

  • Download URL: hipda-0.2.1.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hipda-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fcae476610155ced8a89d8227cad27c8cf1f2875b83fd2219bdefb1d2f82ecc1
MD5 f32cdb97b2718e8e989c99445d8de1a9
BLAKE2b-256 6a6f39d9ef271df41bcced3f8c9dee05bc3d07a2c3c25e2d4f4aa643a2591f8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for hipda-0.2.1.tar.gz:

Publisher: python-publish.yml on cdpath/hipda

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

File details

Details for the file hipda-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: hipda-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hipda-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 807b70488aee052ad171243e527f0f6ad135a0c0378a6f91cd74f37d93eeebef
MD5 4abed76d8330e8bbc2fd500e5230b5ab
BLAKE2b-256 ae3f1ff69f56a71fe0f91ee6714753995e15191f082204d6772ef2904a0048a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for hipda-0.2.1-py3-none-any.whl:

Publisher: python-publish.yml on cdpath/hipda

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page