Commit ca986886 authored by Ilkka Ollakka's avatar Ilkka Ollakka

appletrailers_iphone: add play-and-stop to optionlist, not sure they work corretly in this form

Also check that hd is true and add different hd-resolutions (with albumart) to playlist.
parent 3765f1d9
......@@ -34,14 +34,20 @@ end
-- Parse function.
function parse()
p = {}
path=""
arturl=""
title=""
description=""
while true
do
line = vlc.readline()
if not line then break end
for path in string.gmatch( line, "http://trailers.apple.com/movies/.-%.mov" ) do
path = vlc.strings.decode_uri( path )
path = string.gsub( path, "r320i.mov","h480p.mov")
table.insert( p, { path=path; name=title; description=description; options={"http-user-agent=Quicktime/7.2.0 vlc lua edition","input-fast-seek";};} )
for urli in string.gmatch( line, "http://trailers.apple.com/movies/.-%.mov" ) do
path = vlc.strings.decode_uri( urli )
vlc.msg.err(path)
end
for urli in string.gmatch( line, "http://.-%/poster.jpg") do
arturl = vlc.strings.decode_uri( urli )
end
if string.match( line, "<title>" )
then
......@@ -52,5 +58,10 @@ function parse()
description = vlc.strings.resolve_xml_special_chars( find( line, "name=\"Description\" content=\"(.-)\"" ) )
end
end
for index,resolution in ipairs({"480p","720p","1080p"}) do
path = string.gsub( path, "r320i.mov","h"..resolution..".mov")
vlc.msg.err(arturl)
table.insert( p, { path=path; name=title.." ("..resolution..")"; arturl=arturl; description=description; options={":http-user-agent=Quicktime/7.2.0 vlc lua edition",":input-fast-seek",":play-and-stop"};} )
end
return p
end
......@@ -32,12 +32,12 @@ end
function main()
fd = vlc.stream( "http://trailers.apple.com/trailers/iphone/home/feeds/just_added.json" )
if not fd then return nil end
options = {"http-user-agent='iPhone'"}
options = {":http-user-agent='iPhone'"}
while true
do
line = fd:readline()
if not line then break end
if string.match( line, "title" ) then
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\":\"(.-)\"")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment