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

if [[ $1 == '-q' ]]
then
	echo "FLVGET_PLUGIN|blip.tv|blip.tv"
	exit 0
fi

url="http://blip.tv$(wget -q -O - "$1" | grep "File:" | cut -d'"' -f2)"
[[ -n $(echo $url | grep -E ".ram$") ]] && url=$(wget -q -O - "$url")
filename=$(echo "$url" | sed -e 's/.*\/\(.*\)$/\1/')

echo "$url|$filename"
