require"idownx"

function issupport(url)
	if url:match('http://www.m1905.com/') then return true end
	return false
end

function analyze(url)
--http://static.m1905.com/profile/vod/5/7/571555_1.xml
	local id = url:match('/(%d+).shtml')
	if not id then return -2 end
	local url2 = 'http://static.m1905.com/profile/vod/'..id:sub(1,1)..'/'..id:sub(2,2)..'/'..id..'_1.xml'
	local page2 = idown.requesturl(url2)
	local title = page2:match('title="(.-)"')

	local result = {}
	result.title = title
	result.realname = title..'.flv'
	result.realurl = page2:match('<item id="1" url="(.-)"')
	result.encode = idown.CP_UTF8

	return idown.ERR_SINGLE_FILE, idown.encode(result)
end