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

if [[ $1 == '-q' ]]
then
	echo "FLVGET_PLUGIN|MonkeyDoo|monkeydoo.com"
	exit 0
fi

url=$(wget -q "$1" -O - | grep files | head -1 | cut -d'"' -f4)
filename=$(echo "$url" | sed -e 's/.*\/\(.*\)$/\1/')

echo "$url|$filename"
