function issupport(url)
    if url:match("^http://%w+.umiwi.com/") then return true end
    return false   
end

function analyze(url)
    print('-----------------------enter analyze-----------------------')
    print('url:'..url)
    require('common')
    local json = require('json')
    require("xml")
    page1=idown.requesturl(url,'','')
    local agent = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)'
    id=string.match(url,'/(%d*).shtml')
    print(id)
    url1='http://app.umiwi.com/popitem.php?t=download&contentid='..id..'&jsoncallback=?'
    page2=idown.requesturl(url1,'','')
    print(page2)
    page3=string.gsub(page2,"%?%(","")
    print('-----------------------1111111111111111111-----------------------')
    req ={}
    retdata =json:decode(page3)
    a=retdata.html
    print(a)
    realurl=string.match(a,'<a href="([^"]*)"')
    print(realurl)
    realname=string.match(page1,'<title>(.*)</title>')
    print(realname)
    print(idown.toansi(realname))
    suffix =getsuffix(getfilename(realurl))
    realfilename=realname..suffix
    result = {}
	result['agent'] = agent 
    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
   
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
   