require('idownx')

function issupport(url)
if url:match('^http://115.com/folder/') then return true end
return false
end

function analyze(url)
local page = idown.requesturl(url)
local aid = page:match("aid: Number%('(%d*)'%)")
local cid = page:match("cid: Number%('(%d*)'%)")
local uid = page:match("user_id: Number%('(%d*)'%)")
local urlapi = string.format('http://web.api.115.com/folder/file?aid=%s&cid=%s&user_id=%s',aid,cid,uid)
local data = idown.requesturl(urlapi)
print(data)
local jdata = idown.decode(data)
for fid,file in pairs(jdata.file) do
local fileurl = 'http://115.com/file/'..file.pick_code
print(fileurl)
idown.addtask(fileurl)
end
return 200
end