Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
66be5f79
Commit
66be5f79
authored
Sep 17, 2011
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vimeo.lua: convert to --preferred-resolution
parent
767cec1d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
share/lua/playlist/vimeo.lua
share/lua/playlist/vimeo.lua
+21
-5
No files found.
share/lua/playlist/vimeo.lua
View file @
66be5f79
...
@@ -20,6 +20,17 @@
...
@@ -20,6 +20,17 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
--]]
--]]
function
get_prefres
()
local
prefres
=
-
1
if
vlc
.
var
and
vlc
.
var
.
inherit
then
prefres
=
vlc
.
var
.
inherit
(
nil
,
"preferred-resolution"
)
if
prefres
==
nil
then
prefres
=
-
1
end
end
return
prefres
end
-- Probe function.
-- Probe function.
function
probe
()
function
probe
()
return
vlc
.
access
==
"http"
return
vlc
.
access
==
"http"
...
@@ -29,7 +40,6 @@ end
...
@@ -29,7 +40,6 @@ end
-- Parse function.
-- Parse function.
function
parse
()
function
parse
()
p
=
{}
if
string.match
(
vlc
.
path
,
"vimeo.com/%d+"
)
then
if
string.match
(
vlc
.
path
,
"vimeo.com/%d+"
)
then
_
,
_
,
id
=
string.find
(
vlc
.
path
,
"vimeo.com/(.*)"
)
_
,
_
,
id
=
string.find
(
vlc
.
path
,
"vimeo.com/(.*)"
)
-- Vimeo disables HD if the user-agent contains "VLC", so we
-- Vimeo disables HD if the user-agent contains "VLC", so we
...
@@ -39,6 +49,8 @@ function parse()
...
@@ -39,6 +49,8 @@ function parse()
end
end
if
string.match
(
vlc
.
path
,
"vimeo.com/moogaloop"
)
then
if
string.match
(
vlc
.
path
,
"vimeo.com/moogaloop"
)
then
prefres
=
get_prefres
()
ishd
=
false
while
true
do
while
true
do
-- Try to find the video's title
-- Try to find the video's title
line
=
vlc
.
readline
()
line
=
vlc
.
readline
()
...
@@ -64,11 +76,15 @@ function parse()
...
@@ -64,11 +76,15 @@ function parse()
if
string.match
(
line
,
"<isHD>1</isHD>"
)
then
if
string.match
(
line
,
"<isHD>1</isHD>"
)
then
ishd
=
true
ishd
=
true
end
end
if
string.match
(
line
,
"<height>%d+</height>"
)
then
_
,
_
,
height
=
string.find
(
line
,
"<height>(%d+)</height>"
)
end
end
end
table.insert
(
p
,
{
path
=
"http://vimeo.com/moogaloop/play/clip:"
..
id
..
"/"
..
rsig
..
"/"
..
rsigtime
;
name
=
name
;
arturl
=
arturl
}
)
path
=
"http://vimeo.com/moogaloop/play/clip:"
..
id
..
"/"
..
rsig
..
"/"
..
rsigtime
if
ishd
==
true
then
if
ishd
and
(
not
height
or
prefres
<
0
or
prefres
>=
tonumber
(
height
)
)
then
table.insert
(
p
,
{
path
=
"http://vimeo.com/moogaloop/play/clip:"
..
id
..
"/"
..
rsig
..
"/"
..
rsigtime
..
"/?q=hd"
;
name
=
name
..
" (HD)"
;
arturl
=
arturl
}
)
path
=
path
..
"/?q=hd"
end
end
return
{
{
path
=
path
;
name
=
name
;
arturl
=
arturl
}
}
end
end
return
p
return
{}
end
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