--http://www.dj89.com/play-40226.html
function issupport(url)
    if url:match("^http://www.dj89.com/") then return true end
    return false
end

function analyze(url)
	print('-----------------------Enter analyze-----------------------')
	print('url:'..url)
	require('common')
	
	--获得音乐文件id
	local id = url:match('play%-(%d+)')
	print('id:'..id)
	
	--组合播放页面地址
	local playerurl = 'http://www.dj89.com/play1.asp?id='..id
	print('playerurl:'..playerurl)
	
	--请求播放页面
	local page = idown.requesturl(playerurl, '', url)
	print(page)
	local realurl = page:match("uus='([^']*)'")
	local realurl = idown.crypt.base64decode(realurl)
	realurl = string.gsub(realurl, "^%s*(.-)%s*$", "%1")
	print('realurl:'..realurl)
		
	--获得文件标题
	local page1 = idown.requesturl(url)
	local title = page1:match('对 %[(.-)%] 进行评论：')
	print('title:'..title)
			
	local realfilename = title..getsuffix(realurl)
	print('realfilename:'..realfilename)
	
	print('-----------------------Leave analyze-----------------------')
	json = require('json')

	result = {}
	result['realurl'] = realurl
	result['title'] = title
	result['realname'] = realfilename

	retstr = json:encode(result)
	print('ret:'..retstr)
	
	return 1, retstr	
end