Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
b63f84d1
Commit
b63f84d1
authored
Sep 11, 2007
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a lua playlist script for trailers.apple.com pages.
parent
7d4a9c96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
share/luaplaylist/appletrailers.lua
share/luaplaylist/appletrailers.lua
+51
-0
No files found.
share/luaplaylist/appletrailers.lua
0 → 100644
View file @
b63f84d1
-- $Id$
--[[
Translate trailers.apple.com video webpages URLs to the corresponding
movie URL
--]]
-- Probe function.
function
probe
()
return
vlc
.
access
==
"http"
and
string.match
(
vlc
.
path
,
"trailers.apple.com"
)
end
-- Parse function.
function
parse
()
p
=
{}
while
true
do
line
=
vlc
.
readline
()
if
not
line
then
break
end
if
string.match
(
line
,
"http://movies.apple.com/movies/.*%.mov"
)
or
string.match
(
line
,
"http://images.apple.com/movies/.*%.mov"
)
then
if
string.match
(
line
,
"http://movies.apple.com/movies/.*%.mov"
)
then
path
=
vlc
.
decode_uri
(
string.gsub
(
line
,
"^.*(http://movies.apple.com/movies/.*%.mov).*$"
,
"%1"
)
)
elseif
string.match
(
line
,
"http://images.apple.com/movies/.*%.mov"
)
then
path
=
vlc
.
decode_uri
(
string.gsub
(
line
,
"^.*(http://images.apple.com/movies/.*%.mov).*$"
,
"%1"
)
)
end
if
string.match
(
path
,
"480p"
)
then
extraname
=
" (480p)"
elseif
string.match
(
path
,
"720p"
)
then
extraname
=
" (720p)"
elseif
string.match
(
path
,
"1080p"
)
then
extraname
=
" (1080p)"
else
extraname
=
""
end
vlc
.
msg_err
(
path
)
table.insert
(
p
,
{
path
=
path
;
name
=
title
..
extraname
;
description
=
description
;
url
=
vlc
.
path
}
)
end
if
string.match
(
line
,
"<title>"
)
then
title
=
vlc
.
decode_uri
(
string.gsub
(
line
,
"^.*<title>([^<]*).*$"
,
"%1"
)
)
end
if
string.match
(
line
,
"<meta name=\"
Description
\
""
)
then
description
=
vlc
.
resolve_xml_special_chars
(
string.gsub
(
line
,
"^.*name=\"
Description
\
" content=\"
([
^
\
"]*)\"
.
*
$
", "
%
1
" ) )
end
end
return p
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment