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

function analyze(url)
    require('common')
    local json = require('json')
    require("xml")
    print('-----------------------enter analyze-----------------------')
    print('url:'..url)
    local agent = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)'
    page1=idown.requesturl(url,'','')
    id=string.match(url,'/([^/]-)$')
    print(id)
    type1= 0
    type1=string.match(id,'_(%d)')
    print(type1)
    ip=string.match(id,'(%d*)_')
    if (type1==nil)then
        iid=1
        url1='http://www.vhxsd.com/jwplayer/getvideo.php?id='..id..'&type='..iid
    else iid=tonumber(type1)+1
        url1='http://www.vhxsd.com/jwplayer/getvideo.php?id='..ip..'&type='..iid
    end
    print(url1)
    page2=idown.requesturl(url1,'','')
    print(page2)
    realurl=page2
    print(realurl)
    realname=string.match(page1,'<title>(.-) |')
    print(idown.toansi(realname))
    suffix =getsuffix(getfilename(realurl))
    realfilename=realname..suffix
    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