#!/bin/bash
#
# FLVGET Plugin for "Evil Chili" version 1.0
# http://www.evilchili.com/
#
# This plugin is released under GPL free license.
#
# Pablo Chinea <khertz@gmail.com>
#################################################

if [[ $1 == '-q' ]]
then
	echo "FLVGET_PLUGIN|Evil Chili|evilchili.com"
	exit 0
fi

#url=$(wget -q "$1" -O - | grep embed | cut -d'"' -f12)
url=$(wget -q "http://evilchili.com/skin/config.php?id=$(echo "$1" | cut -d'/' -f5)" -O - | grep FLVPath | cut -d'"' -f4)
filename=$(echo "$1" | sed -e 's/.*\/\(.*\)$/\1/').flv

echo "$url|$filename"
