function issupport(url)
    if url:find("duomi.com/") then return true end
    return false
end

function analyze(url)
	print('-----------------------Enter analyze-----------------------')
	print('url:'..url)
	
    local json = require('json')
    require('common')

	--local page = idown.requesturl(url)
	
	local id = url:match('duomi.com/(.-)/')
	local url2 = string.format('http://s.duomi.com/control/player.php?cmd=media&song_id=%s', id)
	page2,head = idown.requesturl(url2, '', url)
	print(head)

    local realurl = head:match("Location: (.-)\r\n")	
	local songname = page:match("var _musicName = '([^']*)")
	local singer = page:match("var _musicArtist = '([^']*)")
	
	local realfilename = string.format('%s - %s%s', singer, songname, getsuffix(getfilename(realurl)))
	local title = realfilename
	print(title)
	
	local result = {}
	result['realurl'] = realurl
	result['title'] = title
	result['realname'] = realfilename
	result['encode'] = 65001
	
	local retstr = json:encode(result)
	print('ret:'..retstr)

	print('-----------------------Leave analyze-----------------------')
	return 1, retstr
end