#!/bin/bash
#
# FLVGET Plugin for "Terror.To" version 1.1
# http://www.terror.to/
#
# This plugin is released under GPL free license.
#
# Pablo Chinea <khertz@gmail.com>
#################################################

if [[ $1 == '-q' ]]
then
	echo "FLVGET_PLUGIN|Terror.To|terror.to"
	exit 0
fi

#url=$(wget -q "$1" -O - | grep embed | cut -d'"' -f22)
url=$(wget -q "$1" -O - | grep x-mplayer2 | cut -d"'" -f16)
filename=$(echo "$url" | sed -e 's/.*\/..\...\(.*\)$/\1/')

echo "$url|$filename"
