require"idownx"

function issupport(url)
	if url:match('http://www.baidu.com/link%?url=') then return true end
	return false
end

function analyze(url)
	local req = {autoredir=0,debug=1}
	local page,head = idown.requesturl(url, idown.encode(req))
	print(head)
	local result={Location=getlocation(head)}
	return 301,idown.encode(result)
end