I've written a couple scripts that helped my setup work better, so I thought it'd be good to share them back to the community. I run mylar on a headless ubuntu server, and download with transmission, so the first script is used to remove the torrent from transmission and move it to the folder you have mylar set to watch.
Code: Select all
#!/bin/sh
# port, username, password
SERVER="9091 --auth <Username>:<Password>"
# use transmission-remote to get torrent list from transmission-remote list
# use sed to delete first / last line of output, and remove leading spaces
# use cut to get first field from each line
TORRENTLIST=`transmission-remote $SERVER --list | sed -e '1d;$d;s/^ *//' | cut --only-delimited --delimiter=" " -$
transmission-remote $SERVER --list
# for each torrent in the list
for TORRENTID in $TORRENTLIST
do
echo Processing : $TORRENTID
# check if torrent download is completed
DL_COMPLETED=`transmission-remote $SERVER --torrent $TORRENTID --info | grep "Percent Done: 100%"`
# check torrents current state is
STATE_STOPPED=`transmission-remote $SERVER --torrent $TORRENTID --info | grep "State: Seeding\|Stopped\|Finish$
echo $STATE_STOPPED
# check torrent is a comic
IS_COMIC=`transmission-remote $SERVER --torrent $TORRENTID --info | grep -i ".cb"`
# where the torrent goes
DEST='/path/to/mylar/watch/folder'
# if the torrent is "Stopped", "Finished", or "Idle after downloading 100%"
if [ "$DL_COMPLETED" ] && [ "$STATE_STOPPED" ] && [ "$IS_COMIC" ]; then
# move the files and remove the torrent from Transmission
echo "Torrent #$TORRENTID is completed"
echo "Removing torrent from list"
transmission-remote $SERVER --torrent $TORRENTID --move "$DEST"
transmission-remote $SERVER --torrent $TORRENTID --remove
else
echo "Torrent #$TORRENTID is not completed. Ignoring."
fi
done
Code: Select all
#!/bin/bash
# The API Keys
API_KEY="<Your pushbullet api key>"
DEVICE_KEY="<Your pushbullet device id>"
# Strings coming from Mylar
FILE_NAME="$3"
# Body of the Message
BODY="Finished post process for ${FILE_NAME}"
curl -k -u "$API_KEY": https://api.pushbullet.com/v2/pushes -d device_iden="$DEVICE_KEY" -d type=note -d title="$FILE_NAME" -d body="$BODY"
I'd like to have the option to be able to set how issues get named on a per-series basis. What I mean is sometimes an issue on ComicVine, is simply not the full name of the comic, and it can drive me crazy. An example of this is Injustice: Gods Among Us. The current run is simply called Injustice: Year Three, http://www.comicvine.com/injustice-year ... 050-77226/, and that makes it impossible to find new issues without setting an alternate search name, and also drives my OCD off the wall. I can change the alternate search name so it finds the new issues, and I can also change the directory name and it'll put the issues in the right place, but it still names the issues "Injustice Year Three 0##" whereas I'd like them to be named "Injustice - Gods Among Us - Year Three 0##".
Another Example of this is Federal Bureau of Physics http://www.comicvine.com/fbp-federal-bu ... 050-66760/. I'd much prefer the issues to be renamed to "Federal Bureau of Physics 0##" rather than "FBP Federal Bureau of Physics 0##". I don't have any problems with any of my other comics though, they all get named exactly as I want based on the settings in my configuration.
Thanks again in advance for any insight/help you may be able to offer, and thanks again for such an awesome product at our disposal!