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
52cc3eab
Commit
52cc3eab
authored
May 19, 2007
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* youtube_homepage.lua: get the stream's duration.
parent
6323eda2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
share/luaplaylist/youtube_homepage.lua
share/luaplaylist/youtube_homepage.lua
+15
-4
No files found.
share/luaplaylist/youtube_homepage.lua
View file @
52cc3eab
...
...
@@ -8,11 +8,22 @@ function parse()
do
line
=
vlc
.
readline
()
if
not
line
then
break
end
for
path
,
artist
,
name
in
string.gmatch
(
line
,
"href=\"
(
/
watch
%
?
v
=
[
^
\
"]*)\"
onclick
=
\
"_hbLink%('([^']*)','Vid[^\']*'%);\"
>
([
^<
]
*
)
</
a
><
br
/>
" )
for
_path
,
_artist
,
_
name
in
string.gmatch
(
line
,
"href=\"
(
/
watch
%
?
v
=
[
^
\
"]*)\"
onclick
=
\
"_hbLink%('([^']*)','Vid[^\']*'%);\"
>
([
^<
]
*
)
</
a
><
br
/>
" )
do
path = "
http
:
//
www
.
youtube
.
com
" .. path
name = vlc.resolve_xml_special_chars( name )
table.insert( p, { path = path; name = name; artist = artist } )
path = "
http
:
//
www
.
youtube
.
com
" .. _path
name = vlc.resolve_xml_special_chars( _name )
artist = _artist
end
for _min, _sec in string.gmatch( line, "
<
span
class
=
\
"runtime\"
>
(
%
d
*
):(
%
d
*
)
</
span
>
" )
do
duration = 60 * _min + _sec
end
if path and name and artist and duration then
table.insert( p, { path = path; name = name; artist = artist; duration = duration } )
path = nil
name = nil
artist = nil
duration = nil
end
end
return p
...
...
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