-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaddon.py
42 lines (27 loc) · 979 Bytes
/
addon.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from xbmcswift2 import Plugin, xbmcgui
import tripler
plugin = Plugin()
@plugin.route('/')
def main_menu():
items = [
{'label': plugin.get_string(30000),'path': "http://media.on.net/radio/114.m3u",'is_playable': True},
{'label': plugin.get_string(30001), 'path': plugin.url_for(program_menu)},
{'label': plugin.get_string(30002), 'path': plugin.url_for(audio_archives)},
]
return items
@plugin.route('/program_menu/')
def program_menu():
programs = tripler.get_programs("/programs/podcasts")
items = []
for program in programs:
items.append({'label': program['title'], 'path': program['url'], 'is_playable': True})
return items
@plugin.route('/audio_archives/')
def audio_archives():
archives = tripler.get_audio()
items = []
for archive in archives:
items.append({'label': archive['title'], 'path': archive['url'], 'is_playable': True})
return items
if __name__ == '__main__':
plugin.run()