Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
4d376677
Commit
4d376677
authored
May 13, 2007
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* test.lua: Use spaces instead of tabs in lua code.
parent
02474925
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
49 deletions
+49
-49
share/luaplaylist/test.lua
share/luaplaylist/test.lua
+49
-49
No files found.
share/luaplaylist/test.lua
View file @
4d376677
...
...
@@ -2,74 +2,74 @@
if
vlc
.
access
~=
"http"
then
return
false
return
false
end
url
=
nil
title
=
nil
function
get_url_param
(
url
,
name
)
return
string.gsub
(
vlc
.
path
,
"^.*"
..
name
..
"=([^&]*).*$"
,
"%1"
)
return
string.gsub
(
vlc
.
path
,
"^.*"
..
name
..
"=([^&]*).*$"
,
"%1"
)
end
if
string.match
(
vlc
.
path
,
"youtube.com"
)
then
if
string.match
(
vlc
.
path
,
"watch%?v="
)
then
url
=
string.gsub
(
vlc
.
path
,
"^(.*)watch%?v=([^&]*).*$"
,
"http://%1v/%2"
)
while
not
title
do
line
=
vlc
.
readline
()
if
not
line
then
break
end
if
string.match
(
line
,
"<meta name=\"
title
\
""
)
then
title
=
string.gsub
(
line
,
"^.*content=\"
([
^
\
"]*).*$"
,
"%1"
)
end
end
elseif
string.match
(
vlc
.
path
,
"watch_fullscreen%?video_id="
)
or
string.match
(
vlc
.
path
,
"p.swf"
)
or
string.match
(
vlc
.
path
,
"player2.swf"
)
then
video_id
=
get_url_param
(
vlc
.
path
,
"video_id"
)
t
=
get_url_param
(
vlc
.
path
,
"t"
)
url
=
"http://www.youtube.com/get_video.php?video_id="
..
video_id
..
"&t="
..
t
if
string.match
(
vlc
.
path
,
"title="
)
then
title
=
get_url_param
(
vlc
.
path
,
"title"
)
end
end
if
string.match
(
vlc
.
path
,
"watch%?v="
)
then
url
=
string.gsub
(
vlc
.
path
,
"^(.*)watch%?v=([^&]*).*$"
,
"http://%1v/%2"
)
while
not
title
do
line
=
vlc
.
readline
()
if
not
line
then
break
end
if
string.match
(
line
,
"<meta name=\"
title
\
""
)
then
title
=
string.gsub
(
line
,
"^.*content=\"
([
^
\
"]*).*$"
,
"%1"
)
end
end
elseif
string.match
(
vlc
.
path
,
"watch_fullscreen%?video_id="
)
or
string.match
(
vlc
.
path
,
"p.swf"
)
or
string.match
(
vlc
.
path
,
"player2.swf"
)
then
video_id
=
get_url_param
(
vlc
.
path
,
"video_id"
)
t
=
get_url_param
(
vlc
.
path
,
"t"
)
url
=
"http://www.youtube.com/get_video.php?video_id="
..
video_id
..
"&t="
..
t
if
string.match
(
vlc
.
path
,
"title="
)
then
title
=
get_url_param
(
vlc
.
path
,
"title"
)
end
end
elseif
string.match
(
vlc
.
path
,
"dailymotion.com"
)
then
len
,
str
=
vlc
.
peek
(
9
)
if
str
==
"<!DOCTYPE"
then
while
not
url
do
line
=
vlc
.
readline
()
if
string.match
(
line
,
"param name=\"
flashvars
\
" value=\"
url
=
" )
then
url = vlc.decode_uri( string.gsub( line, "
^
.
*
param
name
=
\
"flashvars\"
value
=
\
"url=([^&]*).*$"
,
"%1"
)
)
end
end
end
len
,
str
=
vlc
.
peek
(
9
)
if
str
==
"<!DOCTYPE"
then
while
not
url
do
line
=
vlc
.
readline
()
if
string.match
(
line
,
"param name=\"
flashvars
\
" value=\"
url
=
" )
then
url = vlc.decode_uri( string.gsub( line, "
^
.
*
param
name
=
\
"flashvars\"
value
=
\
"url=([^&]*).*$"
,
"%1"
)
)
end
end
end
elseif
string.match
(
vlc
.
path
,
"video.google.com"
)
and
string.match
(
vlc
.
path
,
"videoplay"
)
then
url
=
string.gsub
(
vlc
.
path
,
"^.*(docid=[^&]*).*$"
,
"http://video.google.com/videogvp?%1"
)
url
=
string.gsub
(
vlc
.
path
,
"^.*(docid=[^&]*).*$"
,
"http://video.google.com/videogvp?%1"
)
elseif
string.match
(
vlc
.
path
,
"metacafe.com"
)
then
if
string.match
(
vlc
.
path
,
"watch/"
)
then
url
=
string.gsub
(
vlc
.
path
,
"^.*watch/(.*[^/])/?$"
,
"http://www.metacafe.com/fplayer/%1.swf"
)
elseif
string.match
(
vlc
.
path
,
"mediaURL="
)
then
url
=
string.gsub
(
vlc
.
path
,
"^.*mediaURL=([^&]*).*$"
,
"%1"
)
end
if
string.match
(
vlc
.
path
,
"watch/"
)
then
url
=
string.gsub
(
vlc
.
path
,
"^.*watch/(.*[^/])/?$"
,
"http://www.metacafe.com/fplayer/%1.swf"
)
elseif
string.match
(
vlc
.
path
,
"mediaURL="
)
then
url
=
string.gsub
(
vlc
.
path
,
"^.*mediaURL=([^&]*).*$"
,
"%1"
)
end
end
if
url
==
nil
then
return
false
return
false
else
return
true
,
url
,
title
return
true
,
url
,
title
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