Repository navigation
Add M-Team torrent detail and search category names - #26
Merged
Merged
Conversation
M-Team now declares torrent.detail. `site detail --api-key-stdin mteam ID` sends one bounded multipart POST to /api/torrent/detail carrying only the ID, never the view-counting endpoint, and accepts only a code 0 answer that echoes the exact ID and has a name. Not found is read only from code 1 with the exact fixed message, because the API reuses code 1 for other refusals. Search rows gain category_name from a static table of the site's category list, so a search costs no extra request; the table view adds a trailing CATEGORY column only when some row has a name. The site detail warning is now chosen by route ID, so TJUPT output is unchanged and unknown routes get only the generic sentence. Reconcile still reads live detail with a cookie only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
torrent.detail.site detail --api-key-stdin mteam REMOTE_IDsends one bounded multipartPOST /api/torrent/detailwith only theidfield. It never calls/api/torrent/viewHits, which the website calls to count a view, and it never retries or follows redirects. The answer must be code0and must echo the exact requested ID and carry a name. Size, seeders, leechers, and completed count are mapped; a malformed counter is left absent.DOWNLOAD REFERENCEis alwaysfalse.1for a missing torrent, but code1is also used for other refusals (for example the per-torrent daily download limit). Only code1with null data and the exact種子未找到/种子未找到message maps tonot_found; any other code1isunrecognized_response. Server text is never echoed.TorrentSummarygainscategory_name(omitempty). M-Team fills it from a static table of the site'scategoryList(nameChs, 48 entries, snapshotted 2026-10-16), so search makes no extra request. Unknown IDs keep only their ID.site detailwarning is now chosen by route ID. TJUPT keeps its exact sentence; M-Team states its own no-counter choice; an unlisted route gets only the generic first clause.Deliberate public changes
category_nameon search rows (omitted when unknown, so TJUPT JSON is byte-identical).CATEGORYcolumn only when at least one row has a name. TJUPT rows never have one, so TJUPT table output is unchanged.torrent.detail:site listshows 4 capabilities for mteam andsite capabilities mteamgains a row.site detailaccepts--api-key-stdin(mutually exclusive with--cookie-stdin). The usage line is nowptctl site detail (--cookie-stdin | --api-key-stdin) .... Without a credential flag, the usage error names the flag the site needs (--api-key-stdinfor mteam,--cookie-stdinfor tjupt, unchanged); choosing the wrong one givessite "X" does not support METHOD authenticationbefore stdin is read.the single request is tracker-visibleinstead of the TJUPT-specific sentence.Unchanged: TJUPT detail output, stop reasons and their order, exit codes, route IDs, origins.
reconcilestill requires cookie detail, so--site-ref mteam/IDis refused with the existing text.Verification
gofmt -l .,go vet ./...,go test -race ./...,go build -trimpath ./cmd/ptctlpass locally.CANARYfixtures only: exact request shape (including the multipart body), field mapping, ID echo and name requirements, refusal classification, one-request session budget and close semantics, and credential-method checks before stdin is read.not_foundwith one request.viewHitswas never called.Docs:
MTEAM_ADAPTER.md,guide/sites.md,FEATURES.md,ADDING_A_SITE.md(gap table),AUTOMATION.md,ARCHITECTURE.md,README.md,docs/README.md.Metafile download for M-Team is not part of this PR.
🤖 Generated with Claude Code