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
7144c1d3
Commit
7144c1d3
authored
Apr 24, 2013
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua: sd: strengthen icecast. (fix #8425)
XML is correct, but data is still random and full of junk...
parent
ff7aeef9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
share/lua/sd/icecast.lua
share/lua/sd/icecast.lua
+10
-6
No files found.
share/lua/sd/icecast.lua
View file @
7144c1d3
...
...
@@ -25,12 +25,16 @@ function descriptor()
return
{
title
=
"Icecast Radio Directory"
}
end
function
dropnil
(
s
)
if
s
==
nil
then
return
""
else
return
s
end
end
function
main
()
local
tree
=
simplexml
.
parse_url
(
"http://dir.xiph.org/yp.xml"
)
for
_
,
station
in
ipairs
(
tree
.
children
)
do
simplexml
.
add_name_maps
(
station
)
local
station_name
=
station
.
children_map
[
"server_name"
][
1
].
children
[
1
]
if
station_name
==
"Unspecified name"
or
station_name
==
""
if
station_name
==
"Unspecified name"
or
station_name
==
""
or
station_name
==
nil
then
station_name
=
station
.
children_map
[
"listen_url"
][
1
].
children
[
1
]
if
string.find
(
station_name
,
"radionomy.com"
)
...
...
@@ -41,15 +45,15 @@ function main()
end
vlc
.
sd
.
add_item
(
{
path
=
station
.
children_map
[
"listen_url"
][
1
].
children
[
1
],
title
=
station_name
,
genre
=
station
.
children_map
[
"genre"
][
1
].
children
[
1
]
,
nowplaying
=
station
.
children_map
[
"current_song"
][
1
].
children
[
1
]
,
genre
=
dropnil
(
station
.
children_map
[
"genre"
][
1
].
children
[
1
])
,
nowplaying
=
dropnil
(
station
.
children_map
[
"current_song"
][
1
].
children
[
1
])
,
uiddata
=
station
.
children_map
[
"listen_url"
][
1
].
children
[
1
]
..
station
.
children_map
[
"server_name"
][
1
].
children
[
1
]
,
..
dropnil
(
station
.
children_map
[
"server_name"
][
1
].
children
[
1
])
,
meta
=
{
[
"Listing Source"
]
=
"dir.xiph.org"
,
[
"Listing Type"
]
=
"radio"
,
[
"Icecast Bitrate"
]
=
station
.
children_map
[
"bitrate"
][
1
].
children
[
1
]
,
[
"Icecast Server Type"
]
=
station
.
children_map
[
"server_type"
][
1
].
children
[
1
]
[
"Icecast Bitrate"
]
=
dropnil
(
station
.
children_map
[
"bitrate"
][
1
].
children
[
1
])
,
[
"Icecast Server Type"
]
=
dropnil
(
station
.
children_map
[
"server_type"
][
1
].
children
[
1
])
}}
)
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