#!/bin/bash
#
# FLVGET Plugin for "Cool Clip" version 1.0
# http://www.cool-clip.de/
#
# This plugin is released under GPL free license.
#
# Pablo Chinea <khertz@gmail.com>
#################################################

if [[ $1 == '-q' ]]
then
	echo "FLVGET_PLUGIN|Cool Clip|cool-clip.de"
	exit 0
fi

url=$(wget -q -O - "$1" | grep flv | sed -e 's/.*file=\(.*\.flv\).*/\1/')
filename=$(echo "$1" | sed -e 's/.*\-\(.*\)\.html/\1/').flv

echo "$url|$filename"
