-- phpdisk 6.0.0
function issupport(url)
    if url:match("^http://www.gxp.cc/") then return true end
    return false   
end

function analyze(url)
    json = require("json")
    require("common")
    local id = url:match("(%d+).html")
    local domain = url:match('(http://[^/]*)')
   
    url3 = string.format("%s/down-%s.html", domain, id)
    print(url3)
    page3 = idown.requesturl(url3, '', url)
    --print(page3)
    local realurl = page3:match('attr%("href","(.-)"')
    print(realurl)
    
    title = page3:match('thunderResTitle="([^"]*)')
    print(title)
    result = {}
    result.encode = 65001
    result.realurl = realurl
    result.title = title
    result.realname = title
    result.redown = 1
    result.agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1'
    retstr = json:encode(result)
    print("ret:" .. retstr)
    return 1, retstr
end


