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

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

id=$(wget -q "$1" -O - | grep embed | cut -d'"' -f16 | cut -d'/' -f5)
yt="http://www.youtube.com/watch?v=$id"

$(dirname $0)/youtube.sh "$yt"
