updivx/aria2-feeder/feed-aria2.lua

26 lines
452 B
Lua

local base64 = require "base64"
local json = require "json"
local file = arg[1]
local handle = io.open(file)
local full_request = {}
local i = math.random(1, 99999999)
while 1 do
local line = handle:read("*l")
if not line then break end
table.insert(full_request, {
jsonrpc = "2.0",
id = i,
method = "aria2.addUri",
params = {{ line }, { header = { "accept-encoding: gzip, br" } }}
})
i = i + 1
end
print(json.encode(full_request))