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

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

url=$(wget -q "$1" -O - | grep embed | cut -d'"' -f6)
filename="$(echo "$1" | sed -e 's/^.*\/[0-9]*_\(.*\)html$/\1/')$(echo "$url" | sed -e 's/.*\.\(.*\)$/\1/')"

echo "$url|$filename"
