Skip to content

feat(torrent): create v1, v2 and hybrid torrents - #671

Merged
linroid merged 5 commits into
mainfrom
feat/torrent-create
Nov 14, 2026
Merged

linroid merged 5 commits into
mainfrom
feat/torrent-create

Conversation

@linroid

@linroid linroid commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Stacked on #670 (recheck); only the last three commits belong to this PR.

What

The "Creation: v1/v2/hybrid metainfo and magnets" row of #162.

  • SDK: TorrentCreator.create(path, TorrentCreateOptions, onProgress) hashes a file or folder in one pass and returns a CreatedTorrent: the .torrent bytes, the info hashes and the magnet link (none for a private torrent). TorrentFormat is V1 (default), V2 or HYBRID, with BEP 47 padding in hybrids. Options: piece length (a power of two from 16 KiB to 16 MiB, or picked for about a thousand pieces), name, tracker tiers, web seeds, private, comment, creator, creation date and a private tracker's source tag.
  • CLI: ketch create <path> saves <name>.torrent and prints its path and magnet link; --format, --tracker, --web-seed, --private, --piece-length, --name, --comment, --source, -o, --overwrite, --json.
  • Files are listed in the order v2 sorts them, symbolic links are left out, trackers must be ones Ketch can announce to, a private torrent needs one, and a torrent holds at most 10,000 files and 4 MiB of metainfo, the limits Ketch opens.

Testing

  • TorrentCreatorTest: created v1, v2 and hybrid torrents are byte for byte the hand-written fixtures the engine's interoperability tests use; single files, file order, options, piece length choice, progress and refusals.
  • CreatedTorrentInteropTest (JVM): libtorrent opens a created torrent of each format and, checking the files against its hashes, becomes a seed. It would stay a downloader if one piece hash or tree root were wrong.
  • CreateTorrentTest for the command. Core, torrent, remote, server, app and CLI suites pass on this branch; the creator compiles for iOS.

Not built here: a screen for it in the apps. Seeding a created torrent comes with the next PR in the stack (using files already in place).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T04:39:15.993160Z 273f2da PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Nov 14, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 273f2da185

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@linroid
linroid force-pushed the feat/torrent-create branch from 25612b6 to a67d57a Compare November 14, 2026 09:04
@linroid
linroid added this pull request to stack #676 November 14, 2026 09:17
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

 2 293 files  + 9   2 321 suites  +9   58m 20s ⏱️ +32s
16 229 tests +31  15 946 ✅ +31  283 💤 ±0  0 ❌ ±0 
19 740 runs  +51  19 457 ✅ +51  283 💤 ±0  0 ❌ ±0 

Results for commit 1c6cc54. ± Comparison against base commit d1a48f3.

♻️ This comment has been updated with latest results.

@linroid
linroid merged commit ff1e7b3 into main Nov 14, 2026
14 checks passed
@linroid
linroid deleted the feat/torrent-create branch November 14, 2026 11:49
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