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

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

url="$(wget "$1" -q -O - | tr '>' '\n' | grep videothumbnail | cut -d'"' -f4 | sed -e 's/jpg$/flv/')"
filename=$(echo "$url" | sed -e 's/.*\/\(.*\)$/\1/')

echo "$url|$filename"
