|
@@ -12,6 +12,7 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
12
|
12
|
from sources.SourceBase import stream_type
|
13
|
13
|
import util
|
14
|
14
|
|
|
15
|
+show_hidden = False # Ja True, tad vienalga radā hidden sources (noder izstradē)
|
15
|
16
|
|
16
|
17
|
class ContentSources(object):
|
17
|
18
|
"""Wrapper for content sources plugin"""
|
|
@@ -61,19 +62,24 @@ class ContentSources(object):
|
61
|
62
|
def get_content(self,data):
|
62
|
63
|
source = data.split("::")[0]
|
63
|
64
|
if source in self.plugins:
|
64
|
|
- content = self.plugins[source].get_content(data)
|
65
|
|
- if content:
|
66
|
|
- if isinstance(content,list):
|
67
|
|
- for i,item in enumerate(content):
|
|
65
|
+ content0 = self.plugins[source].get_content(data)
|
|
66
|
+ if content0:
|
|
67
|
+ content = []
|
|
68
|
+ if isinstance(content0,list):
|
|
69
|
+ for i,item in enumerate(content0):
|
|
70
|
+ source2 = item[1].split("::")[0]
|
|
71
|
+ if not (source2 == "back" or item[1].startswith("http") or item[1].startswith("rtmp")):
|
|
72
|
+ if source2 not in self.plugins or (not show_hidden and "hidden" in dir(self.plugins[source2]) and self.plugins[source2].hidden):
|
|
73
|
+ continue
|
68
|
74
|
item2=[]
|
69
|
75
|
for el in item:
|
70
|
76
|
if isinstance(el,unicode):
|
71
|
77
|
el = el.encode("utf8")
|
72
|
78
|
item2.append(el)
|
73
|
|
- content[i]=tuple(item2)
|
|
79
|
+ content.append(tuple(item2))
|
74
|
80
|
else:
|
75
|
81
|
item2=[]
|
76
|
|
- for el in content:
|
|
82
|
+ for el in content0:
|
77
|
83
|
if isinstance(el,unicode):
|
78
|
84
|
el = el.encode("utf8")
|
79
|
85
|
item2.append(el)
|
|
@@ -161,6 +167,7 @@ class ContentSources(object):
|
161
|
167
|
|
162
|
168
|
if __name__ == "__main__":
|
163
|
169
|
|
|
170
|
+ show_hidden = False
|
164
|
171
|
sources = ContentSources("sources")
|
165
|
172
|
if len(sys.argv)>1:
|
166
|
173
|
data= sys.argv[1]
|