Advertisement
and_cesbo

Import m3u8 files

Nov 28th, 2018
1,300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. -- Insert this script into Settings -> Import
  2. -- Between [[ and ]] insert your m3u file
  3. -- Press import
  4.  
  5. pls = [[
  6.  
  7. ]]
  8.  
  9. local name = nil
  10. for s in pls:gmatch("(.-)\n") do
  11.     if #s > 0 then
  12.         if s:sub(1, 1) == "#" then
  13.             if s:sub(2, 7) == "EXTINF" then
  14.                 name = s:match(".*,(.*)")
  15.             end
  16.         else
  17.             if name ~= nil then
  18.                 make_channel({ name = name, input = { s }, })
  19.                 name = nil
  20.             end
  21.         end
  22.     end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement