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

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

url=$(wget -q "$1" -O - | tr '
' '\n' | grep "var win_media_url" | cut -d'"' -f2)
filename=$(echo "$1" | sed -e 's/.*\/\(.*\)$/\1/').wmv

echo "$url|$filename"
