Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 895216edef
Fetching contributors…

Cannot retrieve contributors at this time

executable file 37 lines (30 sloc) 0.894 kb
#!/bin/bash
BASE_DIR="/mnt/media/TV"
SERIES="${1}"
SEASON="${2}"
usage() {
echo "Usage: `basename "${0}"` series_name [season]" 1>&2
exit 1
}
# Find the series directory
if echo "${SERIES}" | grep -q "/"; then
SERIES_DIR="${SERIES}"
else
SERIES_DIR="${BASE_DIR}/${SERIES}"
fi
if [ ! -d "${SERIES_DIR}" ]; then
echo "No such series directory: ${SERIES_DIR}" 1>&2
usage
fi
# Find the season directory -- if no season is provided, use the last season in the series directory
if [ -z "${SEASON}" ]; then
SEASON="`ls "${SERIES_DIR}" | awk '$1 == "Season" && $2 ~ "[0-9]*" {print $2}' | sort -n -r | head -n 1`"
SEASON=$(( $SEASON + 0 ))
fi
SEASON_DIR="${SERIES_DIR}/Season ${SEASON}"
if [ ! -d "${SEASON_DIR}" ]; then
echo "No such season directory: ${SEASON_DIR}" 1>&2
usage
fi
# Run the standard command, in debug mode
DEBUG=1 ~/bin/video/findTorrent.pl "${SEASON_DIR}" | download
Jump to Line
Something went wrong with that request. Please try again.