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


function analyze(url)
json = require('json')
require('common')
    print('url:'..url)
    agent = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; GreenBrowser)'
    page1 = idown.requesturl(url, agent, '')
    --print(page1)
    
    realurl=''
    for line in string.gmatch(page1, "G_PLAY_URL='([^']+)") do
    	realurl = line
    	break
    end
    print(realurl)
    
    title = ''
    for line in string.gmatch(page1, "G_TITLE='([^']+)") do
    	title = line
    	break
    end
    print(title)
    
    title = title..getsuffix(realurl)
    realfilename = title

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

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