]> git.sesse.net Git - vlc/commitdiff
appleplaylist.lua: fix apple trailers again, change useragent
authorIlkka Ollakka <ileoo@videolan.org>
Tue, 6 Oct 2009 19:39:18 +0000 (22:39 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Tue, 6 Oct 2009 19:41:35 +0000 (22:41 +0300)
Seems that they changed just on trailers page, that if useragent doesn't
contain QuickTime, it gives redirect back to trailers. So get stuff from movies
again, but tell useragent to be "QuickTime vlc lua edition".

Really if apple doesn't want vlc to be used as see apple-trailes, they could
atleast ask ;)

share/lua/playlist/appletrailers.lua

index c2fa43100d00a63cc27442761819712b09fa26a4..dd1a5f1246da3320c16a0419c11f398d87343826 100644 (file)
@@ -40,7 +40,6 @@ function parse()
         if not line then break end
         for path in string.gmatch( line, "http://movies.apple.com/movies/.-%.mov" ) do
             path = vlc.strings.decode_uri( path )
-            path = string.gsub( path, "http://movies", "http://www" )
             if string.match( path, "320" ) then
                 extraname = " (320p)"
             elseif string.match( path, "480" ) then
@@ -54,7 +53,7 @@ function parse()
             else
                 extraname = ""
             end
-            table.insert( p, { path = path; name = title..extraname; description = description; url = vlc.path } )
+            table.insert( p, { path = path; name = title..extraname; description = description; url = vlc.path; options = ":http-user-agent=\"QuickTime\"" } )
         end
         if string.match( line, "<title>" )
         then