forked from koudi/plugin.video.mall.tv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
addon.py
42 lines (34 loc) · 882 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
# -*- coding: utf-8 -*-
from kodiswift import Plugin
from mall import MallApi
plugin = Plugin()
api = MallApi(plugin)
@plugin.route('/category')
def category_index():
return api.get_categories()
@plugin.route('/category/<link>')
def category(link):
return api.get_category(link)
@plugin.route('/show')
def show_index():
return api.get_shows()
@plugin.route('/show/<link>')
def show(link):
return api.get_show_videos(link)
@plugin.route('/video/<link>')
def video(link):
url = api.get_video_url(link)
plugin.set_resolved_url(url)
@plugin.route('/')
def index():
show = {
'label': plugin.get_string(30002),
'path': plugin.url_for(show_index)
}
category = {
'label': plugin.get_string(30001),
'path': plugin.url_for(category_index)
}
return [show, category]
if __name__ == '__main__':
plugin.run()