autobrr/test/mockindexer
soup 0391629862
chore(license): update copyright year in headers (#1929)
* chore: update copyright year in license headers

* Revert "chore: update copyright year in license headers"

This reverts commit 3e58129c431b9a491089ce36b908f9bb6ba38ed3.

* chore: update copyright year in license headers

* fix: sort go imports

* fix: add missing license headers
2025-01-06 22:23:19 +01:00
..
files feat(tools): Add a simple MockIndexer helper for IRC announcing and indexing (#555) 2022-12-03 16:55:36 +01:00
irc chore(license): update copyright year in headers (#1929) 2025-01-06 22:23:19 +01:00
main.go chore(license): update copyright year in headers (#1929) 2025-01-06 22:23:19 +01:00
README.md feat(mockindexer): support feeds and webhooks (#1361) 2024-01-21 12:12:34 +01:00

autobrr MockIndexer

This is a simple IRC announcer and torrent indexer rolled into one. It is built as a tool for testing IRC announces and actions.

Getting started

  • Put a torrent file in ./files, name it 1.torrent.
  • Run the MockIndexer with go run main.go.

For autobrr, uncomment the customDefinitions line in config.toml to load the extra indexer definitions. Then start autobrr as usual.

  • Add an instance of the MockIndexer in autobrr UI. Pick any nickname, don't set any auth.
  • Set up an action - for example the Watchdir action which will make autobrr actually download the announced torrent file from the MockIndexer.

Post announce

  • Open http://localhost:3999 in your browser. A simple input will allow you to post announces to the channel. For example, to announce the 1.torrent file added to the ./files dir, send this,
New Torrent Announcement: <PC :: Iso>  Name:'debian live 10 6 0 amd64 standard iso' uploaded by 'Anonymous' freeleech -  http://localhost:3999/torrent/1

It is the 1 at the end of the announce line that should match the file name.

RSS Feed

You can use the mockindexer as an RSS feed as well. Place a complete XML feed in ./feeds and name it something like mock.xml.

In autobrr to set up the feed you use the url like http://localhost:3999/feeds/mock where the last part is the name of the xml file without extension.

Webhook

The mockindexer can also be used as a simple webhook endpoint. Use it with a method POST to http://localhost:3999/webhook.

You can trigger different behavior by appending the following URL parameters.

  • timeout=2 - wait for 2 seconds to respond
  • status=500 - respond with status 500

Use it like http://localhost:3999/webhook?timeout=2&status=500.