Skip to content

Add BEP 19 web seed support (url-list) to torrent creation#9

Merged
iksnerd merged 1 commit into
mainfrom
feat/webseed-url-list
Jun 13, 2026
Merged

Add BEP 19 web seed support (url-list) to torrent creation#9
iksnerd merged 1 commit into
mainfrom
feat/webseed-url-list

Conversation

@iksnerd

@iksnerd iksnerd commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Producer-side web-seed support — the highest-leverage item from the dataset strategy (see the weightless-dataset-strategy Council Hub room). Lets a hybrid torrent point at an existing HTTP origin (HF / Kaggle / GCS bucket) as a fallback source, so we can register artifacts that reference an origin instead of rehosting them, and a swarm can form without a persistent always-on seeder.

Changes

  • torrent.CreateOptions gains WebSeeds []string; each entry is validated as an absolute http(s) URL at the boundary (rejects relative paths, ftp://, bare schemes).
  • The url-list key is set on the outer metainfo dict, not the info dict — so the v1/v2 info hashes are unchanged. Verified in test (TestCreateWebSeeds asserts the hash matches the no-webseed build) and confirms url-list is absent when no seeds are given.
  • wl create gains a repeatable --webseed flag (--webseed URL --webseed URL).

Verification

  • go build / go vet / gofmt clean; go test ./... passes (new TestCreateWebSeeds, existing TestHybridGoldenVectors still green → info hash unaffected).
  • Transmission 4.1.2: transmission-show lists both URLs under a WEBSEEDS section, and the v2 hash is byte-identical with and without --webseed.

Scope / follow-up

This is the producer side — real clients (Transmission, libtorrent) already consume the url-list we emit. The wl get consumer side (downloading from web seeds) and wl create --stream <url> (hash a remote origin without persisting locally) are separate follow-ups tracked in the strategy room.

🤖 Generated with Claude Code

Emit a top-level `url-list` key when web seeds are provided, so a hybrid
torrent can point at an existing HTTP origin (HF / Kaggle / GCS bucket) as a
fallback source. This is the producer-side unlock for the dataset strategy:
register artifacts that reference an origin instead of rehosting them, and let
a swarm form without a persistent seeder.

- torrent.CreateOptions gains WebSeeds []string; each is validated as an
  absolute http(s) URL at the boundary.
- url-list is set on the OUTER metainfo dict, not the info dict, so the v1/v2
  info hashes are unchanged (golden vectors still pass — asserted in test).
- wl create gains a repeatable --webseed flag.

Verified with Transmission 4.1.2: transmission-show lists both URLs under a
WEBSEEDS section, and the v2 hash is byte-identical with and without the flag.

Consumer side (wl get downloading from web seeds / streaming-hash create) is a
separate follow-up; real clients (Transmission, libtorrent) already use the
url-list we emit.
@iksnerd iksnerd merged commit 3455f7a into main Jun 13, 2026
1 check passed
@iksnerd iksnerd deleted the feat/webseed-url-list branch June 13, 2026 13:16
iksnerd added a commit that referenced this pull request Jun 21, 2026
Add BEP 19 web seed support (url-list) to torrent creation
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.

1 participant