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

function analyze(url)
    local json = require('json')
    local id = url:match('ref=(%w+)')
    print(id)
    
    local postdata = '\r\n-----------------------------265001916915724\r\nContent-Disposition: form-data; name="code"\r\n\r\n'
..id..'\r\n-----------------------------265001916915724--\r\n'
    print(postdata)
    
    local realname = id..".torrent"
    print(realname)
    
    local realurl = url:gsub('link%.php(.*)$', 'fetch.php')
    print(realurl)
    
    result = {}
    result.verb = "POST"
    result.realname = realname
    result.title = realname
    result.realurl = realurl
    result.postdata = postdata
    result.headers = {}
    result.headers.Referer = url
    result.headers['Content-Range'] = ""
    result.headers['Content-Type'] = "multipart/form-data; boundary=---------------------------265001916915724"
   
    return 1, json:encode(result)
end
