Commits

Tuk Bredsdorff committed 5884cbb

Initial commit.

  • Participants

Comments (0)

Files changed (1)

+#!/bin/sh
+
+# Install the transmission cli tools on Mac with Homebrew:
+# $ brew install transmission
+# Set the path to the executable as well:
+TRANSMISSION_REMOTE=/usr/local/bin/transmission-remote
+
+{
+	# Go to the download directory (the file list is relative to that point)
+	cd "$TR_TORRENT_DIR"
+
+	# For testing, run somthing like
+	# $ transmission-remote --list | grep iso
+	# and pick an id. Uncomment and set it in the line below:
+	# TR_TORRENT_ID=74
+
+	# Get the files of the torrent we are interested in
+	files=$($TRANSMISSION_REMOTE -t $TR_TORRENT_ID --info-files | tail -n +3 | cut -c 35- | grep -ie \.iso$)
+
+	# Run in subshell so IFS only will be changed for this loop
+	(
+		IFS=$'\n' # Delimit by newline
+	
+		for file in "$files"
+		do
+			echo "$file"
+			# Set your mkv conversion command here:
+			/Volumes/makemkv_v1.8.9/MakeMKV.app/Contents/MacOS/makemkvcon info iso:"$file" --messages=/tmp/mkv.log
+		done
+	)
+
+} & # Run in background as it might take some time