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

if [[ $1 == '-q' ]]
then
	echo "FLVGET_PLUGIN|MyVideo.de|myvideo.de"
	exit 0
fi


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

echo "$url|$filename"
