function issupport(url)
    if url:find("^http://djkk.com/") then return true end
    if url:find("^http://www.djkk.com/") then return true end
    return false
end

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

	local page = idown.requesturl(url)
	local bstr = page:match('s_bstr="([^"]+)"')
	print('bstr:',bstr)
	
	local rstr = page:match('righturl="([^"]+)"')
	print('rstr:',rstr)
	
	local realurl = bstr..rstr
	print('realurl:',realurl)
	print(page)
	local title = page:match('id="songname"%>(.-)%</li%>')
	print('title:',title)
		
	if (string.len(title)<=0) then 
		realfilename = getfilename(realurl)
	else
		realfilename = title..getsuffix(realurl)
	end
	print('realfilename:'..realfilename)
	
	local domain = realurl:match('http://([^/]*)')
	local hipageurl = domain..'/hi.htm'
	print('hipageurl:'..hipageurl)
	
	local hipage = idown.requesturl(hipageurl, '', url)
	local cookie = hipage:match('document.cookie="(.-);')
	
	local result = {}
	result['realurl'] = realurl
	result['title'] = title
	result['realname'] = realfilename
	result['agent'] = 'NSPlayer/11.0.5721.5275 WMFSDK/11.0'
	
	headers = {}
	headers['Cookie'] = cookie
	result['headers'] = headers
	
	retstr = json:encode(result)
	print('ret:'..retstr)

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