-
Notifications
You must be signed in to change notification settings - Fork 0
/
categories.py
72 lines (64 loc) · 1.91 KB
/
categories.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# -*- coding: utf-8 -*-
class CInfo:
def __init__(self):
pass
settings = [
{'v_panorama': ['panorama', 'dienos-tema']},
{'v_sportas': ['sportas-orai']},
{'v_klauskite_daktaro': ['klauskite-daktaro']},
{'v_filmai': ['filmai']},
]
statics = [
{'name': 'Serialai',
'url': 'https://www.lrt.lt/tema/serialai',
'genre': 'Serialai',
'id': 'serials'},
{'name': 'Mediateka',
'url': 'https://www.lrt.lt/mediateka',
'genre': 'Mediateka',
'id': 'mediateka'},
{'name': 'Filmai (tema)',
'url': 'https://www.lrt.lt/tema/filmai',
'genre': 'Filmai',
'id': 'movies1'},
{'name': 'Elito kinas',
'url': 'https://www.lrt.lt/tema/elito-kinas',
'genre': 'Filmai',
'id': 'movies2'},
{'name': 'Dokumentiniai filmai (tema)',
'url': 'https://www.lrt.lt/tema/dokumentinis-filmas',
'genre': 'Filmai',
'id': 'documentary'},
{'name': 'Dokumentiniai filmai',
'url': 'https://www.lrt.lt/mediateka/video/kiti/filmai/dokumentiniai-filmai',
'genre': 'Filmai',
'id': 'documentary1'}
]
def get(addon):
res = []
for st in statics:
c = CInfo()
c.name = st['name']
c.id = st['id']
c.url = st['url']
res.append(c)
for set in settings:
for key in set:
if addon.getSetting(key) == "true":
for v_name in set[key]:
c = CInfo()
c.name = v_name.title()
c.id = "video-" + v_name
c.url = "https://www.lrt.lt/mediateka/video/" + v_name
res.append(c)
video = addon.getSetting("video")
videos = video.split(",")
for v in videos:
v = v.strip()
if v:
c = CInfo()
c.name = v.title()
c.id = "video-" + v
c.url = "https://www.lrt.lt/mediateka/video/" + v
res.append(c)
return res