[vlc-commits] commit: appletrailers sd: fix parsing (Ilkka Ollakka )

git at videolan.org git at videolan.org
Mon May 17 12:43:12 CEST 2010


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Mon May 17 13:42:00 2010 +0300| [989723b2c1d8854e279898f25d83d783c3534b73] | committer: Ilkka Ollakka 

appletrailers sd: fix parsing

Fix parsing to get trailertype. Should help to view all the trailers now.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=989723b2c1d8854e279898f25d83d783c3534b73
---

 share/lua/sd/appletrailers.lua |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/share/lua/sd/appletrailers.lua b/share/lua/sd/appletrailers.lua
index eea68cf..3afd184 100644
--- a/share/lua/sd/appletrailers.lua
+++ b/share/lua/sd/appletrailers.lua
@@ -40,9 +40,17 @@ function main()
          if string.match( line, "title" ) and string.match( line, "hd\":true")then
             title = vlc.strings.resolve_xml_special_chars( find( line, "title\":\"(.-)\""))
             art = find( line, "poster\":\"(.-)\"")
-            url = find( line, "url\":\"(.-)\"")
-            url = string.gsub( url, "trailers/","trailers/iphone/")
-            url = "http://trailers.apple.com"..url.."trailer/"
+            url = find( line, "location\":\"(.-)\"")
+            trailertype = ""
+            trailertype = find( line, "type\":\"(.-)\"")
+            vlc.msg.err(trailertype)
+            if trailertype then
+               trailertype = string.gsub( trailertype, " ", "")
+               trailertype = string.lower( trailertype )
+            else
+               trailertype = "trailer"
+            end
+            url = "http://trailers.apple.com"..url..trailertype.."/"
             vlc.sd.add_item( { path = url, name=title, title=title, options=options, arturl=art})
          end
     end



More information about the vlc-commits mailing list