]> git.sesse.net Git - vlc/commitdiff
lua: assembleenationale: Fix after website changes
authorFrançois Revol <revol@free.fr>
Fri, 19 Jul 2013 20:35:38 +0000 (22:35 +0200)
committerRafaël Carré <funman@videolan.org>
Mon, 22 Jul 2013 13:42:45 +0000 (15:42 +0200)
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@free.fr>
Signed-off-by: Rafaël Carré <funman@videolan.org>
share/lua/sd/assembleenationale.lua

index 1aa1945045cfba5a06c76f5ac758b78a5ce55243..5f0ec908629fa9ded7807eee4838d29fa0274ba9 100644 (file)
@@ -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, "\"([^\"]+)\"" )