LUA networking disabled ?

Discuss your Lua playlist, album art and interface scripts.
spark90
Blank Cone
Blank Cone
Posts: 23
Joined: 31 Mar 2021 03:00

LUA networking disabled ?

Postby spark90 » 05 Apr 2021 00:32

Since a while, freebox.luac doesn't works anymore for french Free ISP tv broadcast.

This is relative to vlc.stream() which returns nil

I'v try to find a workaround with vlc.net.connect_tcp(), vlc.net is nil


Is this normal, since when have things been going like this ?

Thx
Spark

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: LUA networking disabled ?

Postby Rémi Denis-Courmont » 05 Apr 2021 08:28

Since the connection fails.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

spark90
Blank Cone
Blank Cone
Posts: 23
Joined: 31 Mar 2021 03:00

Re: LUA networking disabled ?

Postby spark90 » 05 Apr 2021 15:15

Here more informations:

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

Log:
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)

spark90
Blank Cone
Blank Cone
Posts: 23
Joined: 31 Mar 2021 03:00

Re: LUA networking disabled ?

Postby spark90 » 05 Apr 2021 15:40

The "stream" I want to open is "http://mafreebox.freebox.fr/freeboxtv/playlist.m3u", this link works great (if your ISP is "Free" in France www.free.fr)

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: LUA networking disabled ?

Postby mederi » 05 Apr 2021 17:34

README.txt
Net
---
----------------------------------------------------------------
/!\ NB: this namespace is ONLY usable for interfaces and extensions.
---
----------------------------------------------------------------
So you cannot use it within SD script.

spark90
Blank Cone
Blank Cone
Posts: 23
Joined: 31 Mar 2021 03:00

Re: LUA networking disabled ?

Postby spark90 » 05 Apr 2021 18:02

can you link me the REAL readme.txt please ?

https://www.videolan.org/developers/vlc ... README.txt is broken

Thx !!

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: LUA networking disabled ?

Postby mederi » 05 Apr 2021 19:05

The Lua "README.txt" for current VLC 3 can be found here: https://forum.videolan.org/viewtopic.ph ... 44#p497170

spark90
Blank Cone
Blank Cone
Posts: 23
Joined: 31 Mar 2021 03:00

Re: LUA networking disabled ?

Postby spark90 » 06 Apr 2021 22:58

Hello !

More informations about my stream problem :

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
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
The stream object m3ustream is not nil => Display "stream OK" in debug console.

But when I want to read the first line with m3ustream:readline(), it returns nil !!!

What am I doing wrong ? The playlist seams to be fetched !

spark90
Blank Cone
Blank Cone
Posts: 23
Joined: 31 Mar 2021 03:00

Re: LUA networking disabled ?

Postby spark90 » 06 Apr 2021 23:21

The playlist url http://mafreebox.freebox.fr/freeboxtv/playlist.m3u

returns :
#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)
...
...
...

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: LUA networking disabled ?

Postby mederi » 07 Apr 2021 16:01


spark90
Blank Cone
Blank Cone
Posts: 23
Joined: 31 Mar 2021 03:00

Re: LUA networking disabled ?

Postby spark90 » 07 Apr 2021 16:57

The link works only if your ISP is "Free ('www.free.fr)" in France !
This is a special url wich returns iptv (and TNT streams if the TV player is connected to an antenna) urls to watch TV on PC.

You've just to open a network stream http://mafreebox.freebox.fr/freeboxtv/playlist.m3u and here you are !

But I want something more easy. (and parse the long TV streams into categories : HD, SD, TNT, IPTV, etc...)

I've put a copy of the playlist on http://www.frachebois.net/playlist.m3u if you want to test ! (but the streams won't works unless you are a "Free" subscriber)
Last edited by spark90 on 07 Apr 2021 17:02, edited 1 time in total.

spark90
Blank Cone
Blank Cone
Posts: 23
Joined: 31 Mar 2021 03:00

Re: LUA networking disabled ?

Postby spark90 » 07 Apr 2021 17:01

The old freebox.lua script doesn't work anymore for 2 reasons :
- vlc.stream() is broken
- logos retrieving in the script can't work because the pages urls have been changed since 2010... so the html has changed too... => It can't retrieve anything

spark90
Blank Cone
Blank Cone
Posts: 23
Joined: 31 Mar 2021 03:00

Re: LUA networking disabled ?

Postby spark90 » 07 Apr 2021 17:06

There is a hack : https://www.triades.net/9-blog/20-plugi ... 3-0-x.html wich provide an adapted script, but the playlist retrieving is disabled ! It's a static list.
You can see it a the end of : http://www.triades.net/downloads/freebox-static.lua

And in this static file, the TNT streams are missing... I've just updated the script with my own playlist.m3u returned by http://mafreebox.freebox.fr/freeboxtv/playlist.m3u (and if my TV player IP change, it will not work, I will update the script again...

Example of TNT stream :

#EXTINF:0,1 - TF1 (TNT)
rtsp://192.168.0.31/fbxdvb/stream?tsid=6&nid=8442&sid=1537&frontend=1

192.168.0.31 is my TV player IP connected to a TNT antenna.

spark90
Blank Cone
Blank Cone
Posts: 23
Joined: 31 Mar 2021 03:00

Re: LUA networking disabled ?

Postby spark90 » 07 Apr 2021 19:38

I'm in touch with a VLC dev, it seems to be a BUG in VLC 3.0.12 (and previous). vlc.stream() seams broken for m3u

spark90
Blank Cone
Blank Cone
Posts: 23
Joined: 31 Mar 2021 03:00

Re: LUA networking disabled ?

Postby spark90 » 08 Apr 2021 04:59

It seems that the web server is the problem !

HTTP headers :
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
50f ??? WTF ??

I think it's why vlc.stream() can't parse the playlist !

spark90
Blank Cone
Blank Cone
Posts: 23
Joined: 31 Mar 2021 03:00

Re: LUA networking disabled ?

Postby spark90 » 08 Apr 2021 21:34

I found the problem, this is due to chunked HTTP1.1 transfert mode
Sending HTTP/1.0 returns the playlist content without parasites characters.

I've now a pure lua/vlc implementation of vlc.stream() wich works well (and use vlc.net within an extension)

spark90
Blank Cone
Blank Cone
Posts: 23
Joined: 31 Mar 2021 03:00

Re: LUA networking disabled ?

Postby spark90 » 09 Apr 2021 22:45

Problem solved ! 50f is a chunk hexadecimal length from HTTP/1.1 standard when "Transfer-Encoding: chunked" HTTP HEADER is used.

my HTTP parser is now finished and handle trunks. My retreived content is clean :)

pierrealain6913
New Cone
New Cone
Posts: 1
Joined: 10 May 2021 18:38

Re: LUA networking disabled ?

Postby pierrealain6913 » 11 May 2021 19:12

Hi,
There are two computers at my home. One is a desktop with Intel Core i5 at 2.5 GHz and Windows 10 Family Version 2004.
VLC 3.0.13 Vetirani is installed and the link http://mafreebox.freebox.fr/freeboxtv/playlist.m3u to look at the TV from the french ISP (FREE) works fine;

The second is a tower with Intel Core i7 at 3.6 GHz and Windows 10 Professional version 20H2.
VLC 3.0.13 Vetirani is installed and the same link lets the screen black and an orange band runs from left to right and right to left indefinitly on the state line.

Anybody has an idea ?
Regards,
pierrealain6913.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 6 guests