Skip to content

Integrate upstream PR #175 (TorrentLeech adapter + others) - #1

Merged
patrickdundas merged 6 commits into
mainfrom
feat/torrentleech
Jul 29, 2026
Merged

Integrate upstream PR #175 (TorrentLeech adapter + others)#1
patrickdundas merged 6 commits into
mainfrom
feat/torrentleech

Conversation

@patrickdundas

Copy link
Copy Markdown
Owner

Pulls in upstream PR #175 whole, as the base for our TorrentLeech work.

Why the whole PR and not just TorrentLeech: all four adapters in jordanlambrecht#175 touch the same shared files (src/lib/adapters/index.ts, adapters/constants.ts, lib/parser.ts). Extracting TL alone would leave this fork carrying divergent copies of those, which conflicts when upstream merges jordanlambrecht#175. Taken whole, that future merge is a no-op. The extra adapters (Zenith, BTN fix, IPTorrents) are additive and never execute unless those trackers are configured.

Still to do in this forkparseTlProfile() stubs three fields:

  • hitAndRuns: null ← the reason we forked; needs a logged-in profile capture
  • requiredRatio: null
  • warned: null (feeds the warned notification event)

🤖 Generated with Claude Code

clawdbrunner and others added 6 commits July 25, 2026 17:22
### Zenith (znth.cx)
- New registry entry (UNIT3D platform)
- Uses existing Unit3dAdapter

### BroadcasTheNet (BTN)
- Fixed: was listed as Gazelle 'Unvalidated' — never worked
- New custom BTN JSON-RPC adapter (platform: 'btn')
- POST JSON-RPC to api.broadcasthe.net, maps Lumens→seedbonus
- Un-stucks the BTN entry — now fully functional

### IPTorrents (IPT)
- New custom adapter (cookie + HTML scrape)
- Parses .tTipWrap/.tTip header stats and .up-stat cards
- Credential format: {cookies, userAgent} JSON

### TorrentLeech (TL)
- New custom adapter (username/password login + HTML scrape)
- POSTs to /user/account/login/, captures tluid/tlpass cookies
- Parses .profile-*-details spans from profile page
- Credential format: {username, password} JSON

### Files
- 7 new files, 6 edited files
- All 2848 tests pass (78 new)
- TypeScript and biome lint clean
H1: mark Class, Lumens, Bonus, HnR, JoinDate as optional in
BtnUserInfoResult. use nullish coalescing fallbacks in mapBtnResult
so adapter degrades gracefully if BTN changes API response shape.

H2: replace BigInt(parseInt()) with BigInt(string) to preserve
full precision for byte values exceeding Number.MAX_SAFE_INTEGER.

add test for missing optional fields scenario.

Fixes: QA H1+H2
parseBytes: return 0n for ∞/Inf/-∞/-Inf values so UNIT3D
trackers (e.g. zenith) that return infinite buffer don't crash
the poll with 'Invalid byte format' error.

iptorrents: inspect Location header on 302 rather than throwing
session-expired on every redirect. iptorrents 302s logged-in
users from / to /t — only throw when redirected to a login page.
follow non-login redirects up to 3 hops.

add 6 new tests (4 parseBytes ∞ variants, 2 ipt redirect).
2855 total tests pass, tsc clean.

Fixes: 86bae41991a748
- H1: Handle infinity values case-insensitively (e.g. 'inf', 'INF').
- H2: Fix relative redirect resolution in IPTorrents fetchHtml.
- Added tests for case-insensitive infinity and path-relative redirects.

Fixes: 86bae41991a748
…rrents, TorrentLeech adapters)

Taken whole rather than extracting only TorrentLeech: all four adapters touch
the same shared files (src/lib/adapters/index.ts, adapters/constants.ts,
lib/parser.ts). Cherry-picking TL alone would leave this fork carrying
divergent copies of those, which conflicts when upstream merges jordanlambrecht#175. Taking
the branch whole makes that future merge a no-op.

Upstream PR: jordanlambrecht#175
Set version to 2.8.9-homelab.1. release.yml only publishes when
package.json's version has no matching GitHub Release, so fork builds need a
distinct version or no image is produced. The -homelab.N suffix also keeps our
tags from colliding with upstream release tags.

Add FORK.md covering lineage, branch strategy, the upstream sync procedure,
and the deltas we carry.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@patrickdundas
patrickdundas merged commit 93fabdb into main Jul 29, 2026
@patrickdundas
patrickdundas deleted the feat/torrentleech branch July 29, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants