[vlc-commits] lua: assembleenationale: Fix after website changes

François Revol git at videolan.org
Mon Jul 22 16:00:31 CEST 2013


vlc/vlc-2.1 | branch: master | François Revol <revol at free.fr> | Fri Jul 19 22:35:38 2013 +0200| [744649f6d6f1a4f5af156b8182e6b421fb2ed1c7] | committer: Jean-Baptiste Kempf

lua: assembleenationale: Fix after website changes

The streams lists were just moved out from direct.js to streams.js.

Streams still use crappy proprietary formats with ugly resolution,
can't do anything for this... If only they used a fixed playlist...

Signed-off-by: François Revol <revol at free.fr>
Signed-off-by: Rafaël Carré <funman at videolan.org>
(cherry picked from commit 976eec1cc78f888b261cdd32bc81ff8c26b107cd)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=744649f6d6f1a4f5af156b8182e6b421fb2ed1c7
---

 share/lua/sd/assembleenationale.lua |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/share/lua/sd/assembleenationale.lua b/share/lua/sd/assembleenationale.lua
index 1aa1945..5f0ec90 100644
--- a/share/lua/sd/assembleenationale.lua
+++ b/share/lua/sd/assembleenationale.lua
@@ -96,7 +96,20 @@ function main()
         elseif( string.find( line, "urlIPhone = \"" ) ) then
             _, _, path = string.find( line, "\"([^\"]+)\"" )
             iphone_base = path
-        elseif( string.find( line, "var streamNames = new Array" ) ) then
+        end
+        line = fd:readline()
+    end
+
+    -- fetch the streams JS file
+    fd, msg = vlc.stream( "http://www.assemblee-nationale.tv/ahp/scripts/streams.js" )
+    if not fd then
+        vlc.msg.warn(msg)
+        return nil
+    end
+
+    line = fd:readline()
+    while line ~= nil do
+        if( string.find( line, "var streamNames = new Array" ) ) then
             _, _, str = string.find( line, "Array%( (.*)%);" )
             repeat
                 _, len, s = string.find( str, "\"([^\"]+)\"" )



More information about the vlc-commits mailing list