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

if [[ $1 == '-q' ]]
then
	echo "FLVGET_PLUGIN|Exbyte|exbyte.net"
	exit 0
fi

url=$(wget -q "$1" -O - | grep "Click here to download" | cut -d'"' -f4)
filename=$(echo "$1" | sed -e 's/.*\/\(.*\)\.html/\1/' -e 's/\..*\./\./').$(echo $url | sed -e 's/.*\.\([[:alnum:]]*\)$/\1/')

echo "$url|$filename"

