Ale5000, you're back???Previously I was appending the custom headers to the User-Agent but it was blocked in VLC.
My script strictly depend from custom HTTP headers, is there a new way to set custom headers?
The Rai streaming server don't work at all without setting authentication in the custom HTTP header.Useragent, yes; custom headers, no.
I haven't too much free time but yesAle5000, you're back???
Great! We've made sooo much progress on subtitlesI haven't too much free time but yesAle5000, you're back???
How are you?
Check following topic: https://forum.videolan.org/viewtopic.php?f=29&t=109033Edit: It would be nice to be able to set custom headers in a way like this: http://w3.impa.br/~diego/software/luasocket/http.html
Yes, send your custom HTTP request directly over sockets. The low-level HTTP request API has been not exposed to Lua.Previously I was appending the custom headers to the User-Agent but it was blocked in VLC.
My script strictly depend from custom HTTP headers, is there a new way to set custom headers?
Well, with some efforts maybe I can do this but then I will receive the streaming data directly from the live streaming; how can I make VLC play data directly?Yes, send your custom HTTP request directly over sockets. The low-level HTTP request API has been not exposed to Lua.Previously I was appending the custom headers to the User-Agent but it was blocked in VLC.
My script strictly depend from custom HTTP headers, is there a new way to set custom headers?
Isn't there any plan to extend the functionality of LUA Addons?Lua scripts can only generate playlist items, not streams. You may need to write a custom native plugin for that specific use case - but on the bright side, a native plugin might be able to use the low-level HTTP request API.
Well, this is just the last resort until someone add the feature to pass custom headers (that shouldn't be hard, I don't need to set cookies or things where security can be a problem but just custom non-standard headers "viaurl" and "ttAuth", maybe also others to simulate a real browser but they aren't really important).I don't think Lua should be allowed to generate actual streams. Performance would most certainly suck.
1) A new version VLC supports the header line, and suddenly everything breaks.Custom headers shouldn't be handled at all (they should just be passed), it should simply reject them if they contain special characters like ' " : \r \n \0 (or to be safer allow only alphanumeric characters) under header field name and under header field value (name and value handled separately) and nothing bad can happen.
And also it could skip the ones already handled like: Connection, Cookie, User-Agent, etc.
What can happen in the worst case?
I haven't yet had time to look at them directly but from the VLC changelog I see many new subtitles format supported and many interesting changes, great workGreat! We've made sooo much progress on subtitlesI haven't too much free time but yesAle5000, you're back???
How are you?
3) If you don't even know, then how will code know?
13.5.1 End-to-end and Hop-by-hop Headers
For the purpose of defining the behavior of caches and non-caching proxies, we divide HTTP headers into two categories:
End-to-end headers, which must be transmitted to the ultimate recipient of a request or response. End-to-end headers in responses must be stored as part of a cache entry and transmitted in any response formed from a cache entry.
Hop-by-hop headers, which are meaningful only for a single transport-level connection, and are not stored by caches or forwarded by proxies.
The following HTTP/1.1 headers are hop-by-hop headers:
Connection
Keep-Alive
Public
Proxy-Authenticate
Transfer-Encoding
Upgrade
All other headers defined by HTTP/1.1 are end-to-end headers.
Hop-by-hop headers introduced in future versions of HTTP MUST be listed in a Connection header, as described in section 14.10.
Code: Select all
my_item.set_custom_request_header(string name, string val, bool end_to_end_header=true)
Code: Select all
local element = { title=current_title, path=current_path }
local my_item = vlc.sd.add_item(element)
my_item.set_custom_request_header("MyCustomHeader1", "123", true)
my_item.set_custom_request_header("MyCustomHeader2", "345", true)
It may be a solution but it is too much problematic to load compiled code since it is OS dependent and the script will never be universal.Check following topic: https://forum.videolan.org/viewtopic.php?f=29&t=109033Edit: It would be nice to be able to set custom headers in a way like this: http://w3.impa.br/~diego/software/luasocket/http.html
Wrong. The specification only says that Connection, Keep-Alive, Public, Proxy-Authenticate, Transfer-Encoding, Upgrade are hop-by-hop, and other header lines from the specification are end-to-end.So, all custom headers are end-to-end headers, from the quote it doesn't seems hard to detect it.
Return to “Scripting VLC in lua”
Users browsing this forum: No registered users and 5 guests