and_cesbo icon

Import m3u8 files

and_cesbo | PRO | 11/28/18 10:49:00 AM UTC | 0 ⭐ | 2312 👁️ | Never ⏰ | []
Lua |

510 B

|

None

|

0 👍

/

0 👎

-- Insert this script into Settings -> Import
-- Between [[ and ]] insert your m3u file
-- Press import
 
pls = [[
 
]]
 
local name = nil
for s in pls:gmatch("(.-)\n") do
    if #s > 0 then
        if s:sub(1, 1) == "#" then
            if s:sub(2, 7) == "EXTINF" then
                name = s:match(".*,(.*)")
            end
        else
            if name ~= nil then
                make_channel({ name = name, input = { s }, })
                name = nil
            end
        end
    end
end

Comments