require"idownx"

function issupport(url)
if url:match('http://movie.douban.com/trailer/%d+') then return true end
return false
end

function analyze(url)
	local page = idown.requesturl(url)
	local id = url:match('http://movie.douban.com/trailer/(%d+)')
	local url2 = 'http://movie.douban.com/trailer/video_url?tid='..id
	
	local result = {}
	result.realurl = url2
	result.title = page:match('<title>(.-)</title>')
	result.realname = result.title..'.flv'
	result.encode = 65001

	return 201, idown.encode(result)
end