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
19d9676f
Commit
19d9676f
authored
Sep 19, 2011
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dailymotion.lua: re-enable HD and convert to --preferred-resolution
parent
bcd48040
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
20 deletions
+36
-20
share/lua/playlist/dailymotion.lua
share/lua/playlist/dailymotion.lua
+36
-20
No files found.
share/lua/playlist/dailymotion.lua
View file @
19d9676f
...
...
@@ -4,7 +4,7 @@
$Id$
Copyright © 2007 the VideoLAN team
Copyright © 2007
-2011
the VideoLAN team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -21,6 +21,17 @@
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.
function
probe
()
return
vlc
.
access
==
"http"
...
...
@@ -35,13 +46,12 @@ end
-- Parse function.
function
parse
()
prefres
=
get_prefres
()
while
true
do
line
=
vlc
.
readline
()
if
not
line
then
vlc
.
msg
.
err
(
"Couldn't extract the video URL from dailymotion"
)
return
{
}
if
not
line
then
break
end
if
string.match
(
line
,
"
\"
sequence\"
,
")
then
...
...
@@ -57,24 +67,30 @@ function parse()
description
=
string.gsub
(
description
,
"+"
,
" "
)
end
--[[ we get a list of different streams available, at various codecs
and resolutions:
Ideally, VLC would propose the different streams available,
codecs and resolutions (the resolutions are part of the URL)
For now we just built a list of preferred codecs : lowest value
means highest priority
]]
--
-- FIXME: the hd/hq versions (in mp4) cause a lot of seeks,
-- for now we only get the sd (in flv) URL
for
_
,
param
in
ipairs
({
"hd1080URL"
,
"hd720URL"
,
"hqURL"
,
"sdURL"
})
do
path
=
string.match
(
line
,
"
\"
"
..
param
..
"
\"
:\"
([
^
\
"]*)\"" )
if path then
if prefres < 0 then
break
end
height = string.match( path, "
/
cdn
/%
w
+%-%
d
+
x
(
%
d
+
)
/
video
/
" )
if not height then
height = string.match( param, "
(
%
d
+
)
" )
end
if not height or tonumber(height) <= prefres then
break
end
end
end
-- if not path then path = find( line, "\"hqURL\":\"([^\"]*)\"") end
-- if not path then path = find( line, "\"hdURL\":\"([^\"]*)\"") end
if
not
path
then
path
=
find
(
line
,
"
\"
sdURL\"
:
\
"([^\"
]
*
)
\
""
)
end
if not path then
break
end
return { { path = path; name = name; description = description; url = vlc.path; arturl = arturl } }
end
end
vlc.msg.err("
Couldn
't extract the video URL from dailymotion")
return { }
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