Skip to content

feat(tracker): add Jackett/Torznab provider and POST /api/files endpoint#3

Merged
pkarpovich merged 18 commits into
masterfrom
jackett-provider-and-api-endpoint
Mar 14, 2026
Merged

feat(tracker): add Jackett/Torznab provider and POST /api/files endpoint#3
pkarpovich merged 18 commits into
masterfrom
jackett-provider-and-api-endpoint

Conversation

@pkarpovich

Copy link
Copy Markdown
Owner

Summary

  • Add Jackett/Torznab provider that parses RSS feeds from Jackett indexers, supporting magnet links from both <link> and <enclosure> elements with TrackerURL swap logic
  • Refactor Provider interface to be self-contained with CanHandle(url) / Parse(ctx, url) methods, making each provider own its fetch + parse logic
  • Add POST /api/files HTTP endpoint for creating tracking tasks programmatically (beyond Telegram bot)
  • Bump version to v1.1.0

Test plan

  • Unit tests for Jackett provider XML parsing (jackett_test.go) — various feed formats, empty feeds, missing tracker URLs
  • Unit tests for HTTP endpoint (client_test.go) — valid/invalid requests, auth validation
  • Integration tests for Jackett provider registration (integration_test.go)
  • Parser tests for TrackerURL swap logic (parser_test.go)
  • Magnet link utility tests (magnet_test.go)
  • Verify JACKETT_URL env var wiring in compose.yaml
  • Manual test: configure Jackett instance and verify feed parsing end-to-end

🤖 Generated with Claude Code

pkarpovich and others added 18 commits March 12, 2026 23:33
…and CanHandle methods

Each provider (RuTracker, NNMClub) now handles its own HTTP fetching and HTML parsing
internally. Parser delegates to providers via CanHandle/Parse pattern, removing goquery
dependency from parser.go. Tests updated to use httptest and mock providers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix nil pointer panic in NnmProvider.getLastComment when RSS parsing fails
- Fix graceful shutdown using cancelled context (use context.Background)
- Validate non-empty hash from magnet before storing (return 400)
- Fix extractMagnet returning non-magnet link silently (return empty)
- Add btih hash fallback for Jackett extractID when URL patterns fail
- Add dryMode support to HTTP magnet handler
- Clean up stored record on download failure in magnet path
- Use generic error messages in HTTP responses (no internal details)
- Check json.Encode error in handleCreateFile response
- Extract toResponse helper to deduplicate FileMetadata mapping
- Remove unused JACKETT_API_KEY config field and compose entry
- Remove unused default provider fallback in NewParser
- Replace debug JSON marshal failure point with Printf format
- Update README with Jackett, API endpoint, qBittorrent docs
- Update CLAUDE.md HTTP server description

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pkarpovich pkarpovich merged commit b46b141 into master Mar 14, 2026
3 checks passed
@pkarpovich pkarpovich deleted the jackett-provider-and-api-endpoint branch March 14, 2026 23:22
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