--http://www.56.com/u53/v_NjQxMDI1ODY.html
function issupport(url)
	if url:find('^http://www.56.com/') then return true end
	return false
end

function analyze(url)
    local json = require('json')
    require('common')
    print('---------------enter analyze---------------')
    print('url:'..url)
    
    --获得视频id
    id =url:match('v_(%w*).html')
    print(id)
    
    --拼接id找到下载地址页面
    url1='http://vxml.56.com/json/'..id..'/'
    page1 = idown.requesturl(url1)
    retdata = json:decode(page1)
	print(page1)
    
    --找到真实的下载地址
    local realurl=''
    a=retdata.info.rfiles
    for i=1,#a do
        if a[i].type==clear then 
            realurl=a[i].url
        else
            realurl=a[1].url
        end
    end
    print(realurl)
    
    local realname=retdata.info.Subject
    print(idown.toansi(realname)) 
    --获取文件后缀
    local suffix =getsuffix(getfilename(realurl))
    local realfilename=realname..suffix
    
    local result = {}
    result['realurl'] = realurl
    result['title'] = realname
    result['realname'] = realfilename
    result['encode'] = 65001
    retstr = json:encode(result)
	print('ret:'..retstr)

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