forked from Twilight0/plugin.video.euronews.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
addon.py
42 lines (30 loc) · 869 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 -*-
'''
Euronews Addon
Author Twilight0
SPDX-License-Identifier: GPL-3.0-only
See LICENSES/GPL-3.0-only for more information.
'''
from __future__ import absolute_import
from sys import argv
from tulip.compat import parse_qsl
from resources.lib import euronews
params = dict(parse_qsl(argv[2].replace('?','')))
action = params.get('action')
url = params.get('url')
if action is None:
euronews.indexer().root()
elif action == 'programs':
euronews.indexer().programs()
elif action == 'videos':
euronews.indexer().videos(url)
elif action == 'live':
euronews.indexer().live()
elif action == 'play':
euronews.indexer().play(url)
elif action == 'clear_cache':
from tulip.cache import clear
clear(withyes=False)
elif action == 'settings':
from tulip.control import openSettings
openSettings()