forked from kodi-community-addons/script.skin.helper.service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.py
96 lines (86 loc) · 3.62 KB
/
plugin.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import xbmc
import xbmcplugin
import xbmcgui
from resources.lib.Utils import *
from resources.lib.PluginContent import *
class Main:
def __init__(self):
logMsg('started loading pluginentry')
#get params
params = urlparse.parse_qs(sys.argv[2][1:].decode("utf-8"))
logMsg("Parameter string: %s" % sys.argv[2])
if params:
path=params.get("path",None)
if path: path = path[0]
limit=params.get("limit",None)
if limit: limit = int(limit[0])
else: limit = 25
action=params.get("action",None)
if action: action = action[0].upper()
if action:
if action == "NEXTEPISODES":
getNextEpisodes(limit)
if action == "NEXTAIREDTVSHOWS":
getNextAiredTvShows(limit)
elif action == "RECOMMENDEDMOVIES":
getRecommendedMovies(limit)
elif action == "RECOMMENDEDMEDIA":
getRecommendedMedia(limit)
elif action == "RECENTMEDIA":
getRecentMedia(limit)
elif action == "SIMILARMOVIES":
getSimilarMovies(limit)
elif action == "INPROGRESSMEDIA":
getInProgressMedia(limit)
elif action == "INPROGRESSANDRECOMMENDEDMEDIA":
getInProgressAndRecommendedMedia(limit)
elif action == "FAVOURITEMEDIA":
getFavouriteMedia(limit)
elif action == "PVRCHANNELS":
getPVRChannels(limit)
elif action == "RECENTALBUMS":
getRecentAlbums(limit)
elif action == "RECENTSONGS":
getRecentSongs(limit)
elif action == "RECENTPLAYEDALBUMS":
getRecentPlayedAlbums(limit)
elif action == "RECENTPLAYEDSONGS":
getRecentPlayedSongs(limit)
elif action == "PVRRECORDINGS":
getPVRRecordings(limit)
elif action == "FAVOURITES":
getFavourites(limit)
elif action == "SMARTSHORTCUTS":
getSmartShortcuts(path)
elif action == "BACKGROUNDS":
getBackgrounds()
elif action == "WIDGETS":
getWidgets(path)
elif action == "GETTHUMB":
getThumb(path)
elif action == "WIDGETS":
getWidgets(path)
elif action == "GETCAST":
movie=params.get("movie",None)
if movie: movie = movie[0]
tvshow=params.get("tvshow",None)
if tvshow: tvshow = tvshow[0]
movieset=params.get("movieset",None)
if movieset: movieset = movieset[0]
getCast(movie,tvshow,movieset)
elif action == "LAUNCHPVR":
if path:
xbmc.executeJSONRPC('{ "jsonrpc": "2.0", "id": 0, "method": "Player.Open", "params": { "item": {"channelid": ' + path + '} } }')
elif action == "LAUNCH":
path = sys.argv[2].split("&path=")[1]
if path:
xbmc.executebuiltin(path)
else:
#do plugin main listing...
doMainListing()
if (__name__ == "__main__"):
Main()
logMsg('finished loading pluginentry')