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


if [[ $1 == '-q' ]]
then
	echo "FLVGET_PLUGIN|Myspace.com|vids.myspace.com"
	exit 0
fi

id=$(echo $1 | sed -e 's/[^0-9]*//g')
url=$(wget -q -O - "http://mediaservices.myspace.com/services/rss.ashx?type=video&videoID=$id" | grep content | cut -d'"' -f2)
filename="$id.flv"

echo "$url|$filename"
