Catch¶
Catch is a macOS menu bar app that reads an RSS feed of TV episodes, such as a ShowRSS feed, and hands each new item to a torrent client. app-setup/catch-setup.sh installs Catch for the operator account, writes its feed, save folder and history cutoff into its preferences, and adds a LaunchAgent that starts it when operator logs in. Catch is optional. The rest of the stack works without it.
Before you start¶
- Get the RSS feed URL for your shows, for example from your ShowRSS account page.
-
Set the Catch keys in
config/config.confon the dev Mac before you build the package, or in~/app-setup/config/config.confon the server before you run the script:Key Default What it does CATCH_FEEDS_URL(empty) The feed that Catch reads. When it is empty, Catch installs and starts with no feeds, and you add a feed in the app. CATCH_HISTORY_CUTOFF_DAYS7Catch does not download feed items older than this number of days. 0turns the cutoff off, so Catch can download every item in the feed.CATCH_USE_MAGNETStrueMeant to choose between magnet links and .torrentfiles. No script reads this key yet. See Magnet links and .torrent files.DROPBOX_LOCAL_PATH(empty) The folder where Catch saves .torrentfiles. When it is empty, the script uses/Users/operator/.local/sync/dropbox. -
For magnet links, set up Transmission first.
podman-transmission-setup.shinstalls the macOS magnet link handler that Catch hands magnet links to. See Transmission first install.
All keys are listed in Configuration keys.
Set it up¶
Run these steps as admin on the server.
-
Go to the app setup folder. The script stops if you run it from another folder:
-
Run the Catch script:
The script does these things:
- It installs the
catchHomebrew cask, unless it is already installed. First boot installs it fromconfig/casks.txt, so this step usually finds it. - It creates the save folder for
operator. - It deletes all of the operator's existing Catch preferences (
defaults delete org.giorgiocalderolla.Catch). Then it writes the save folder (savePath), automatic update checks, and one feed namedShowRSSwith theCATCH_FEEDS_URLaddress. - When
CATCH_HISTORY_CUTOFF_DAYSis more than 0, it adds one history entry namedSETUP_CUTOFF, dated that many days ago. Catch treats items before that date as already downloaded. - It writes the LaunchAgent
/Users/operator/Library/LaunchAgents/com.<hostname>.catch.plist. The agent runs/Applications/Catch.app/Contents/MacOS/Catchat load and does not restart it if it quits.
- It installs the
-
Log in as
operator, or restart the server so thatoperatorlogs in automatically. The script does not load the LaunchAgent, so Catch starts at the next operator login. - As
operator, look for the Catch icon in the menu bar. Open its preferences and confirm the feed and the save folder.
Warning
Each run of catch-setup.sh deletes the operator's Catch preferences first, including Catch's download history and any feeds that you added in the app. Only the CATCH_FEEDS_URL feed and the new cutoff entry come back.
Magnet links and .torrent files¶
A feed item can be a magnet link or a link to a .torrent file. The repo handles the two cases differently.
- Magnet links.
podman-transmission-setup.shbuilds~/Applications/TransmissionMagnetHandler.appforoperatorand registers it as the handler formagnet:links. When Catch opens a magnet link, macOS passes it to that app. The app runs~/.local/bin/transmission-add-magnet.sh, which sends the link to Transmission through its RPC address,http://localhost:9091/transmission/rpc(the port isTRANSMISSION_HOST_PORT, 9091 by default). The script shows a macOS notification for success or failure. - .torrent files. Catch saves the file to its save folder, which is
DROPBOX_LOCAL_PATH. Transmission reads new torrents from/Users/operator/containers/transmission/watch. No script in the repo moves files from the save folder to the watch folder, so a saved.torrentfile does not reach Transmission by itself.
catch-setup.sh does not set the Catch preference that controls what Catch does with magnet links, and no script reads CATCH_USE_MAGNETS. Check that preference in the Catch app.
Check¶
Run these checks as admin.
-
The feed and the save folder are in the operator's Catch preferences:
sudo -iu operator defaults read org.giorgiocalderolla.Catch feeds sudo -iu operator defaults read org.giorgiocalderolla.Catch savePathThe first command prints your feed URL. The second prints the save folder.
-
The LaunchAgent exists and passes the plist check:
The output ends with
OK. Replacemacminiwith your server name in lower case. -
After
operatorlogs in, Catch is running:The output shows a process named
Catch. -
The setup log has no errors. The log is
~/.local/state/macmini-apps.log. Lines from this script start with[Catch Setup].
Related¶
- Transmission first install: the container and the magnet link handler.
- rclone setup: the Dropbox sync that uses the same local folder.
- Configuration keys
- LaunchAgents
- Logs
- Stack matrix