Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
2d8becef
Commit
2d8becef
authored
Apr 27, 2013
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix appletrailers playlist parser
parent
e9d9cae0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
share/lua/playlist/appletrailers.lua
share/lua/playlist/appletrailers.lua
+8
-7
No files found.
share/lua/playlist/appletrailers.lua
View file @
2d8becef
...
...
@@ -24,6 +24,7 @@
function
probe
()
return
vlc
.
access
==
"http"
and
string.match
(
vlc
.
path
,
"trailers.apple.com"
)
and
string.match
(
vlc
.
path
,
"web.inc"
)
end
function
find
(
haystack
,
needle
)
...
...
@@ -63,8 +64,9 @@ function parse()
line
=
vlc
.
readline
()
if
not
line
then
break
end
if
string.match
(
line
,
"class=\"
.
-
first
" ) then
description = find( line, "
h
%
d
.
->
(.
-
)
</
h
%
d
") .. ' '
if
string.match
(
line
,
"h%d>.-</h%d"
)
then
description
=
find
(
line
,
"h%d>(.+)</h%d"
)
vlc
.
msg
.
dbg
(
description
)
end
if
string.match
(
line
,
'img src='
)
then
for
img
in
string.gmatch
(
line
,
'<img src="(http://.*%.jpg)" '
)
do
...
...
@@ -73,20 +75,19 @@ function parse()
for
i
,
value
in
pairs
(
playlist
)
do
if
value
.
arturl
==
''
then
playlist
[
i
].
arturl
=
art_url
e
lse break e
nd
end
end
end
if
string.match
(
line
,
'class="hd".-%.mov'
)
then
for urlline,resolution in string.gmatch(line, 'class="
hd
".-href="
(.
-%
.
mov
)
".-(%d+.-p)') do
for
urlline
,
resolution
in
string.gmatch
(
line
,
'class="hd".-href="(.-%.mov)".-
>
(%d+.-p)'
)
do
urlline
=
string.gsub
(
urlline
,
"_"
..
resolution
,
"_h"
..
resolution
)
table.insert
(
playlist
,
{
path
=
urlline
,
name = description
.. '(' .. resolution .. ')'
,
name
=
description
..
" "
..
resolution
,
arturl
=
art_url
,
options = {"
:
http
-
user
-
agent
=
QuickTime
/
7
.
5
", "
:
play
-
and
-
pause
"} } )
options
=
{
":http-user-agent=QuickTime/7.5"
,
":play-and-pause"
,
":demux=avformat"
}
}
)
end
end
end
table.sort(playlist, sort)
return
playlist
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