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

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

id=$(wget -q "$1" -O - | grep postcomment | cut -d'"' -f12)
url=$(wget -q "http://www.yikers.com/playvideo.php?cid=$id" -O - | tr '&' '\n' | grep video_id | cut -d'=' -f2 | sed -e 's/%3A/:/g' -e 's/%2F/\//g')
filename=$(echo $1 | sed -e 's/^.*video_\(.*\).html$/\1.flv/')
#url=$(wget -q "$(wget -q "$1" -O - | grep embed | cut -d'"' -f12)" -O - | grep $filename | cut -d'"' -f2)

echo "$url|$filename"
