]> git.sesse.net Git - vlc/commitdiff
Lua: fix Allocine for large result pages
authorJean-Philippe André <jpeg@videolan.org>
Sat, 22 Jan 2011 13:13:38 +0000 (14:13 +0100)
committerJean-Philippe André <jpeg@videolan.org>
Sat, 22 Jan 2011 13:15:07 +0000 (14:15 +0100)
Some pages are really huge, the only way we are sure we'll
be able to parse them is to download them entirely

share/lua/extensions/allocine-fr.lua

index 5276985a546f2e282e489d1cca25a5aed17403c2..927f0d9c5278eb17fd93253228e1ddb8881045f0 100644 (file)
@@ -157,8 +157,13 @@ function click_chercher()
     vlc.keep_alive()
 
     -- Fetch HTML data (max 65 kb)
-    local data = s:read(65535)
-    vlc.keep_alive()
+    local data = "", tmpdata
+    repeat
+       tmpdata = s:read(65535)
+       vlc.keep_alive()
+       if not tmpdata then break end
+       data = data .. tmpdata
+    until tmpdata == ""
 
     -- Clean data
     data = string.gsub(data, "<b>", "")