|
@@ -28,6 +28,9 @@ proxy_url = plugin.get_setting("general_proxy_url",str)
|
28
|
28
|
playlist = plugin.get_setting("general_playlist",str)
|
29
|
29
|
download_dir = plugin.get_setting("general_download_dir",str)
|
30
|
30
|
view_mode = plugin.get_setting("general_view_mode",str)
|
|
31
|
+streams_file = plugin.get_setting("general_streams_file",str)
|
|
32
|
+streams_file_remote = plugin.get_setting("general_streams_file_remote",str)
|
|
33
|
+use_streams_file_remote = plugin.get_setting("general_use_streams_file_remote",bool)
|
31
|
34
|
|
32
|
35
|
#storage_path = os.path.join(plugin.storage_path,"sources.p")
|
33
|
36
|
if use_storage:
|
|
@@ -60,7 +63,20 @@ if use_storage and storage is not None and "sources" in storage:
|
60
|
63
|
#sources = pickle.load(open(storage_path,"rb"))
|
61
|
64
|
else:
|
62
|
65
|
print "[playstream] Create sources objects"
|
63
|
|
- sources = ContentSources.ContentSources(sources_directory)
|
|
66
|
+ if use_streams_file_remote:
|
|
67
|
+ try:
|
|
68
|
+ sources = ContentSources.ContentSources(sources_directory, streams_file_remote)
|
|
69
|
+ except Exception as e:
|
|
70
|
+ try:
|
|
71
|
+ sources = ContentSources.ContentSources(sources_directory, streams_file)
|
|
72
|
+ plugin.notify("Remote streams file is not available, fallback to local")
|
|
73
|
+ except Exception as e:
|
|
74
|
+ plugin.notify(e.message)
|
|
75
|
+ else:
|
|
76
|
+ try:
|
|
77
|
+ sources = ContentSources.ContentSources(sources_directory, streams_file)
|
|
78
|
+ except Exception as e:
|
|
79
|
+ plugin.notify(e.message)
|
64
|
80
|
|
65
|
81
|
for source in sources.plugins:
|
66
|
82
|
if not ("options" in dir(sources.plugins[source]) and sources.plugins[source].options): continue
|
|
@@ -125,6 +141,7 @@ def get_list(data):
|
125
|
141
|
content = sources.get_content(data)
|
126
|
142
|
print "[playstream] %s items returned"%len(content)
|
127
|
143
|
items = []
|
|
144
|
+ i = 1
|
128
|
145
|
for item in content:
|
129
|
146
|
if item[1] == "back": continue
|
130
|
147
|
title = item[0].decode("utf8") if isinstance(item[0],str) else item[0]
|
|
@@ -140,13 +157,23 @@ def get_list(data):
|
140
|
157
|
("Add to PlayStream favorites",
|
141
|
158
|
u'RunScript(special://home/addons/%s/context_menu.py,"add","%s","%s","%s","%s")'%(
|
142
|
159
|
plugin.id, title, data2 ,img, desc)),
|
|
160
|
+ ]
|
|
161
|
+ if data.startswith("config::"):
|
|
162
|
+ lst = data.split("::")[1]
|
|
163
|
+ context_menu.extend([
|
143
|
164
|
("Delete from PlayStream favorites",
|
144
|
|
- u'RunScript(special://home/addons/%s/context_menu.py,"delete","%s","%s","%s","%s")' % (
|
145
|
|
- plugin.id, title, data2, img, desc)),
|
|
165
|
+ u'RunScript(special://home/addons/%s/context_menu.py,"delete","%s","%s")' % (
|
|
166
|
+ plugin.id, lst, i)),
|
|
167
|
+ ("Move in PlayStream favorites",
|
|
168
|
+ u'RunScript(special://home/addons/%s/context_menu.py,"move","%s","%s")' % (
|
|
169
|
+ plugin.id, lst, i)),
|
|
170
|
+ ])
|
|
171
|
+ if True:
|
|
172
|
+ context_menu.extend([
|
146
|
173
|
("Download",
|
147
|
174
|
u'RunScript(special://home/addons/%s/context_download.py,"download","%s","%s","%s")' % (
|
148
|
175
|
plugin.id, title, data2, download_dir)),
|
149
|
|
- ]
|
|
176
|
+ ])
|
150
|
177
|
item = {
|
151
|
178
|
"label": title,
|
152
|
179
|
"path": prefix+data2,
|
|
@@ -160,6 +187,7 @@ def get_list(data):
|
160
|
187
|
if view_mode == "Poster":
|
161
|
188
|
item["poster"] = thumb_data(img, is_playable)
|
162
|
189
|
items.append(item)
|
|
190
|
+ i += 1
|
163
|
191
|
return items
|
164
|
192
|
|
165
|
193
|
def play_video(streams):
|