]> git.sesse.net Git - vlc/commitdiff
Extensions/Lua script: enhance IMDb descriptor
authorJean-Philippe André <jpeg@videolan.org>
Thu, 28 Jan 2010 23:20:55 +0000 (00:20 +0100)
committerJean-Philippe André <jpeg@videolan.org>
Fri, 29 Jan 2010 00:15:45 +0000 (01:15 +0100)
share/lua/extensions/imdb.lua

index 856293e485b49bb9f15b06d7b5d7dffacda8843b..2eaa7e5edfe6ddaef9909c113b43a8321d2755dc 100644 (file)
 dlg = nil
 txt = nil
 function descriptor()
-    return { title = "IMDb" ; capabilities = {} }
+    return { title = "IMDb - The Internet Movie Database" ;
+             version = "0.1" ;
+             author = "Jean-Philippe André" ;
+             url = 'http://www.imdb.org/';
+             description = "<center><b>The Internet Movie Database</b></center>\n"
+                        .. "Get information about movies from the Internet "
+                        .. "Movie Database (IMDb).\nThis Extension will show "
+                        .. "you the cast, a short plot summary and a link to "
+                        .. "the web page on imdb.org." ;
+             capabilities = {} }
 end
 
 -- Update title text field. Removes file extensions.
@@ -114,7 +123,7 @@ function click_okay()
             if (not table) then break end
             pos = 0
             while (pos ~= nil) do
-                _, _, link = string.find(table, "<a href=\"([^\"]+)\"", pos)
+                _, _, link = string.find(table, "<a href=\"([^\"]+title[^\"]+)\"", pos)
                 if (not link) then break end -- this would not be normal behavior...
                 _, pos, title = string.find(table, "<a href=\"" .. link .. "\"[^>]*>([^<]+)</a>", pos)
                 if (not title) then break end -- this would not be normal behavior...