Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
plugin.audio.fip
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
kodi
plugin.audio.fip
Commits
41379668
Commit
41379668
authored
6 years ago
by
Benoît Harrault
Browse files
Options
Downloads
Patches
Plain Diff
Initial release
parent
6a5519b8
No related branches found
No related tags found
1 merge request
!1
Initial release
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
LICENSE.txt
+21
-0
21 additions, 0 deletions
LICENSE.txt
README.md
+2
-1
2 additions, 1 deletion
README.md
addon.xml
+16
-0
16 additions, 0 deletions
addon.xml
default.py
+93
-0
93 additions, 0 deletions
default.py
icon.png
+0
-0
0 additions, 0 deletions
icon.png
with
132 additions
and
1 deletion
LICENSE.txt
0 → 100644
+
21
−
0
View file @
41379668
The MIT License (MIT)
Copyright (c) 2018 Benoît Harrault
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This diff is collapsed.
Click to expand it.
README.md
+
2
−
1
View file @
41379668
#
plugin.audio.fip
#
Fip Radio KODI Plugin
Listen to FIP radio streams
This diff is collapsed.
Click to expand it.
addon.xml
0 → 100644
+
16
−
0
View file @
41379668
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon
id=
"plugin.audio.fip"
name=
"Fip, an eclectic music radio"
version=
"0.0.1"
provider-name=
"Benoît Harrault"
>
<requires>
<import
addon=
"xbmc.python"
version=
"2.20.0"
/>
</requires>
<extension
point=
"xbmc.python.pluginsource"
library=
"default.py"
>
<provides>
audio
</provides>
</extension>
<extension
point=
"xbmc.addon.metadata"
>
<platform>
all
</platform>
<license>
MIT
</license>
<language>
en
</language>
<summary
lang=
"en"
>
Fip, an eclectic music radio
</summary>
<description
lang=
"en"
>
Listen to fip french radio streams
</description>
</extension>
</addon>
This diff is collapsed.
Click to expand it.
default.py
0 → 100644
+
93
−
0
View file @
41379668
# https://docs.python.org/2.7/
import
os
import
sys
import
urllib
import
urlparse
# http://mirrors.kodi.tv/docs/python-docs/
import
xbmcaddon
import
xbmcgui
import
xbmcplugin
def
get_streams
():
streams
=
{}
base_stream_url
=
'
https://direct.fipradio.fr/live/
'
streams
.
update
({
1
:
{
'
title
'
:
'
fip
'
,
'
url
'
:
base_stream_url
+
'
fip-midfi.mp3?ID=radiofrance
'
,
'
album_cover
'
:
'
https://www.fip.fr/sites/default/files/fip-quadri-filet.png
'
},
2
:
{
'
title
'
:
'
fip / electro
'
,
'
url
'
:
base_stream_url
+
'
fip-webradio8.mp3?ID=radiofrance
'
,
'
album_cover
'
:
'
https://www.fip.fr/sites/default/files/asset/images/2017/05/webradio-electro-small.png
'
},
3
:
{
'
title
'
:
'
fip / groove
'
,
'
url
'
:
base_stream_url
+
'
fip-webradio3.mp3?ID=radiofrance
'
,
'
album_cover
'
:
'
https://www.fip.fr/sites/default/files/asset/images/2016/06/webradio-groove-small.png
'
},
4
:
{
'
title
'
:
'
fip / rock
'
,
'
url
'
:
base_stream_url
+
'
fip-webradio1.mp3?ID=radiofrance
'
,
'
album_cover
'
:
'
https://www.fip.fr/sites/default/files/asset/images/2016/06/webradio-rock-small.png
'
}
})
return
streams
def
build_url
(
query
):
base_url
=
sys
.
argv
[
0
]
return
base_url
+
'
?
'
+
urllib
.
urlencode
(
query
)
def
build_streams_list
(
streams
):
stream_list
=
[]
for
stream
in
streams
:
# create a list item using the stream filename for the label
li
=
xbmcgui
.
ListItem
(
label
=
streams
[
stream
][
'
title
'
],
thumbnailImage
=
streams
[
stream
][
'
album_cover
'
])
# set the fanart to the albumc cover
li
.
setProperty
(
'
fanart_image
'
,
streams
[
stream
][
'
album_cover
'
])
# set the list item to playable
li
.
setProperty
(
'
IsPlayable
'
,
'
true
'
)
# build the plugin url for Kodi
# Example: plugin://plugin.audio.example/?url=http%3A%2F%2Fwww.theaudiodb.com%2Ftestfiles%2F01-pablo_perez-your_ad_here.mp3&mode=stream&title=01-pablo_perez-your_ad_here.mp3
url
=
build_url
({
'
mode
'
:
'
stream
'
,
'
url
'
:
streams
[
stream
][
'
url
'
],
'
title
'
:
streams
[
stream
][
'
title
'
]
})
# add the current list item to a list
stream_list
.
append
((
url
,
li
,
False
))
# add list to Kodi per Martijn
# http://forum.kodi.tv/showthread.php?tid=209948&pid=2094170#pid2094170
xbmcplugin
.
addDirectoryItems
(
addon_handle
,
stream_list
,
len
(
stream_list
))
# set the content of the directory
xbmcplugin
.
setContent
(
addon_handle
,
'
songs
'
)
xbmcplugin
.
endOfDirectory
(
addon_handle
)
def
play_stream
(
url
):
play_item
=
xbmcgui
.
ListItem
(
path
=
url
)
xbmcplugin
.
setResolvedUrl
(
addon_handle
,
True
,
listitem
=
play_item
)
def
main
():
args
=
urlparse
.
parse_qs
(
sys
.
argv
[
2
][
1
:])
mode
=
args
.
get
(
'
mode
'
,
None
)
# initial launch of add-on
if
mode
is
None
:
streams
=
get_streams
()
build_streams_list
(
streams
)
# a stream from the list has been selected
elif
mode
[
0
]
==
'
stream
'
:
# pass the url of the stream to play_stream
play_stream
(
args
[
'
url
'
][
0
])
if
__name__
==
'
__main__
'
:
addon_handle
=
int
(
sys
.
argv
[
1
])
main
()
This diff is collapsed.
Click to expand it.
icon.png
0 → 100644
+
0
−
0
View file @
41379668
14.5 KiB
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment