function issupport(url)
    --http://www.vodtw.com/Html/Book/0/811/871121.html
    if url:match("^http://www.vodtw.com/Html/Book/") then return true end
    return false   
end

function analyze(url)
	print('-----------------------Enter analyze-----------------------')
	print('url:'..url)
	local json = require('json')
	require('common')
	
	local bid,cid = url:match('/(%d+)/(%d+).html')	
	local page = idown.requesturl(url)
	--print(page)

	local title = page:match('<span id="htmltimu">(.-)</span>')
	local bookname = page:match('<a href="/Book/%d+/Index.aspx">(.-)</a>')
	local finaltitle = bookname..'/'..title
	
	local req = {}
	req.method = 'POST'
	req.postdata = string.format('bid=%s&cid=%s', bid, cid)
	req.headers = {Referer=url}

	page2 = idown.requesturl('http://www.vodtw.com/plugin/show.php?r=0.6165029314227575', '', json:encode(req))
	print(page2)
	img = page2:match('%[img](.-)%[/img]')
	if img then
		realurl = 'http://www.vodtw.com'..img

		local result = {}
		result['realurl'] = realurl
		result['title'] = finaltitle
		result['realname'] = result['title']..getsuffix(realurl)
		local retstr = json:encode(result)
		print('ret:'..retstr)
		return 1, retstr
	else
		req.realurl = 'http://www.vodtw.com/plugin/show.php?r=0.6165029314227575'
		req.title = finaltitle
		req.realname = req.title..'.html'
		local retstr = json:encode(req)
		print('ret:'..retstr)
		return 1, retstr
	end

end