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

if [[ $1 == '-q' ]]
then
	echo "FLVGET_PLUGIN|Smog|smog.pl"
	exit 0
fi

id=$(echo "$1" | cut -d'/' -f5)
url="$(wget -q -O - "$1" --post-data="yes=1" | grep flv | cut -d'=' -f6 | cut -d'&' -f1)"
filename=$(echo "$1" | cut -d'/' -f6).flv

echo "$url|$filename"
