function issupport(url)
    if url:match("^http://maxrnb.cn/") then return true end
    return false   
end

function analyze(url)
    require('common')
    
    page1 = idown.requesturl(url, '', '')
    realurl = ''
    for word in string.gmatch(page1, 'lists=&auto_play=1&src=([^"]+)') do
        realurl = word
        break
    end
    
    if string.len(realurl) == 0 then
        return -1
    end
    
if nil == string.find(realurl, 'http://maxrnb.cn') then
    realurl = 'http://maxrnb.cn'..realurl
end
    print(realurl)
   
    --获得文件标题
	title = string.sub(page1, string.find(page1, '<title>.*</title>'))
	title = string.gsub(title, '<title>', '')
	title = string.gsub(title, '</title>', '')
	title = unescapexml(title)
	print('title:'..title)
	
	--获取文件后缀
	suffix = string.sub(realurl, string.find(realurl, '[^.]-$'))
	print('suffix:'..suffix)
    realfilename = title..'.'..suffix
    print(realfilename)

	json = require('json')

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

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