Code: Select all
-- Extension description
function descriptor()
return { title = "Test" }
end
function main()
local conn = vlc.net.connect_tcp("http://wwww.google.fr", 80)
if conn then
vlc.msg.info("Conn OK")
else
vlc.msg.info("Conn KO")
end
end
lua error: Error while running script C:\Users\Spark\AppData\Roaming\vlc\lua\sd\spark_test.lua, function main(): ...sers\Spark\AppData\Roaming\vlc\lua\sd\spark_test.lua:8: attempt to index field 'net' (a nil value)
So you cannot use it within SD script.Net
---
----------------------------------------------------------------
/!\ NB: this namespace is ONLY usable for interfaces and extensions.
---
----------------------------------------------------------------
Code: Select all
function main
local m3ustream = vlc.stream('http://mafreebox.freebox.fr/freeboxtv/playlist.m3u') -- NOT WORKING ???
if m3ustream then
vlc.msg.dbg("stream OK")
else
vlc.msg.dbg("stream KO")
end
local m3u_line = m3ustream:readline()
vlc.msg.dbg(m3u_line)
if m3u_line ~= "#EXTM3U" then
return nil
end
end
The stream object m3ustream is not nil => Display "stream OK" in debug console.main debug: looking for services_discovery module matching "lua": 9 candidates
main debug: set config option: lua-sd to freebox
main debug: using services_discovery module "lua"
main debug: creating access: http://mafreebox.freebox.fr/freeboxtv/playlist.m3u
main debug: (path: \\mafreebox.freebox.fr\freeboxtv\playlist.m3u)
main debug: looking for access module matching "http": 27 candidates
http debug: resolving mafreebox.freebox.fr ...
http debug: outgoing request: GET /freeboxtv/playlist.m3u HTTP/1.1 Host: mafreebox.freebox.fr Accept: */* Accept-Language: fr User-Agent: VLC/3.0.12 LibVLC/3.0.12 Range: bytes=0-
http debug: incoming response: HTTP/1.1 200 OK Server: nginx Date: Tue, 06 Apr 2021 20:48:31 GMT Content-Type: text/plain; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive
main debug: using access module "access"
main debug: looking for stream_filter module matching "prefetch,cache_block": 24 candidates
prefetch debug: using 16777216 bytes buffer, 16777216 bytes read
main debug: using stream_filter module "prefetch"
main debug: looking for stream_filter module matching "any": 24 candidates
playlist debug: found valid M3U playlist
main debug: using stream_filter module "playlist"
main debug: stream filter added to 000001a4866934c0
main debug: looking for stream_filter module matching "any": 24 candidates
main debug: no stream_filter modules matched
lua debug: stream OK
lua error: Error while running script C:\Users\Spark\AppData\Roaming\vlc\lua\sd\freebox.lua, function main(): ...:\Users\Spark\AppData\Roaming\vlc\lua\sd\freebox.lua:106: bad argument #1 to 'dbg' (string expected, got nil)
prefetch debug: end of stream
#EXTM3U
#EXTINF:0,1 - TF1 (TNT)
rtsp://192.168.0.31/fbxdvb/stream?tsid=6&nid=8442&sid=1537&frontend=1
#EXTINF:0,2 - France 2 (auto)
rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=201
#EXTINF:0,2 - France 2 (HD)
rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=201&flavour=hd
#EXTINF:0,2 - France 2 (standard)
rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=201&flavour=sd
#EXTINF:0,2 - France 2 (bas débit)
rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=201&flavour=ld
#EXTINF:0,2 - France 2 (TNT)
...
...
...
The old freebox.lua script doesn't work anymore for 2 reasons :The http://mafreebox.freebox.fr/freeboxtv/playlist.m3u link does not work for me.
The old "freebox.lua" script: https://code.videolan.org/videolan/vlc- ... reebox.lua
50f ??? WTF ??HTTP/1.1 200 OK Server: nginx Date: Thu, 08 Apr 2021 02:45:15 GMT Content-Type: text/plain; charset=utf-8 Transfer-Encoding: chunked Connection: close 50f #EXTM3U #EXTINF:0,1
Return to “Scripting VLC in lua”
Users browsing this forum: No registered users and 6 guests