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
24c2b38b
Commit
24c2b38b
authored
Sep 05, 2008
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix google video playlist script.
(cherry picked from commit
b7e41633
)
parent
1a4dc822
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
12 deletions
+44
-12
share/lua/playlist/googlevideo.lua
share/lua/playlist/googlevideo.lua
+44
-12
No files found.
share/lua/playlist/googlevideo.lua
View file @
24c2b38b
...
@@ -18,26 +18,58 @@
...
@@ -18,26 +18,58 @@
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_url_param
(
url
,
name
)
return
string.gsub
(
url
,
"^.*[&?]"
..
name
..
"=([^&]*).*$"
,
"%1"
)
end
-- Probe function.
-- Probe function.
function
probe
()
function
probe
()
return
vlc
.
access
==
"http"
return
vlc
.
access
==
"http"
and
string.match
(
vlc
.
path
,
"video.google.com"
)
and
string.match
(
vlc
.
path
,
"video.google.com"
)
and
string.match
(
vlc
.
path
,
"videoplay"
)
and
(
string.match
(
vlc
.
path
,
"videoplay"
)
or
string.match
(
vlc
.
path
,
"videofeed"
)
)
end
function
get_arg
(
line
,
arg
)
return
string.gsub
(
line
,
"^.*"
..
arg
..
"=\"
(.
-
)
\
".*$"
,
"%1"
)
end
end
-- Parse function.
-- Parse function.
function
parse
()
function
parse
()
while
true
local
docid
=
get_url_param
(
vlc
.
path
,
"docid"
)
do
if
string.match
(
vlc
.
path
,
"videoplay"
)
then
line
=
vlc
.
readline
()
return
{
{
path
=
"http://video.google.com/videofeed?docid="
..
docid
}
}
if
not
line
then
break
end
elseif
string.match
(
vlc
.
path
,
"videofeed"
)
then
if
string.match
(
line
,
"^<title>"
)
then
local
path
=
nil
title
=
string.gsub
(
line
,
"<title>([^<]*).*"
,
"%1"
)
local
arturl
end
local
duration
if
string.match
(
line
,
"src=\"
/
googleplayer
.
swf
" ) then
local
name
url = string.gsub( line, "
.
*
videoUrl
=
([
^
&
]
*
).
*
" ,"
%
1
" )
local
description
arturl = string.gsub( line, "
.
*
thumbnailUrl
=
([
^
\
"]*).*"
,
"%1"
)
while
true
return
{
{
path
=
vlc
.
strings
.
decode_uri
(
url
),
title
=
title
,
arturl
=
vlc
.
strings
.
decode_uri
(
arturl
)
}
}
do
local
line
=
vlc
.
readline
()
if
not
line
then
break
end
if
string.match
(
line
,
"media:content.*flv"
)
then
local
s
=
string.gsub
(
line
,
"^.*<media:content(.-)/>.*$"
,
"%1"
)
path
=
vlc
.
strings
.
resolve_xml_special_chars
(
get_arg
(
s
,
"url"
))
duration
=
get_arg
(
s
,
"duration"
)
end
if
string.match
(
line
,
"media:thumbnail"
)
then
local
s
=
string.gsub
(
line
,
"^.*<media:thumbnail(.-)/>.*$"
,
"%1"
)
arturl
=
vlc
.
strings
.
resolve_xml_special_chars
(
get_arg
(
s
,
"url"
))
vlc
.
msg
.
err
(
tostring
(
arturl
))
end
if
string.match
(
line
,
"media:title"
)
then
name
=
string.gsub
(
line
,
"^.*<media:title>(.-)</media:title>.*$"
,
"%1"
)
end
if
string.match
(
line
,
"media:description"
)
then
description
=
string.gsub
(
line
,
"^.*<media:description>(.-)</media:description>.*$"
,
"%1"
)
end
end
end
return
{
{
path
=
path
;
name
=
name
;
arturl
=
arturl
;
duration
=
duration
;
description
=
description
}
}
end
end
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