Mythus commited on
Commit
0d18203
·
verified ·
1 Parent(s): f6820e5

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +18 -6
run.py CHANGED
@@ -7,7 +7,7 @@ from streamingwatch import streamingwatch
7
  import json
8
  import config
9
  import logging
10
-
11
  # Configure logging
12
  FILMPERTUTTI = config.FILMPERTUTTI
13
  STREAMINGCOMMUNITY = config.STREAMINGCOMMUNITY
@@ -94,6 +94,11 @@ STREAM = {
94
  ]
95
  }
96
 
 
 
 
 
 
97
  MANIFEST["catalogs"].append({"type": "tv", "id": "channels", "name": "Channels"})
98
 
99
 
@@ -165,10 +170,17 @@ def addon_stream(type, id):
165
  if type == "tv":
166
  for channel in STREAM["channels"]:
167
  if channel["id"] == id:
168
- streams['streams'].append({
169
- 'title': channel['title'],
170
- 'url': channel['url']
171
- })
 
 
 
 
 
 
 
172
  if not streams['streams']:
173
  abort(404)
174
  return respond_with(streams)
@@ -215,4 +227,4 @@ def addon_stream(type, id):
215
 
216
  return respond_with({"meta": meta})
217
  if __name__ == '__main__':
218
- app.run(host=HOST, port=PORT)
 
7
  import json
8
  import config
9
  import logging
10
+ from okru import okru_get_url
11
  # Configure logging
12
  FILMPERTUTTI = config.FILMPERTUTTI
13
  STREAMINGCOMMUNITY = config.STREAMINGCOMMUNITY
 
94
  ]
95
  }
96
 
97
+ okru = {
98
+ "rai1": "https://ok.ru/videoembed/7703488765552?nochat=1",
99
+ "rai2": "https://ok.ru/videoembed/7805618364016?nochat=1"
100
+ }
101
+
102
  MANIFEST["catalogs"].append({"type": "tv", "id": "channels", "name": "Channels"})
103
 
104
 
 
170
  if type == "tv":
171
  for channel in STREAM["channels"]:
172
  if channel["id"] == id:
173
+ if id in okru:
174
+ channel_url = okru_get_url(id)
175
+ streams['streams'].append({
176
+ 'title': "okru"+channel['title'],
177
+ 'url': channel_url
178
+ })
179
+ else:
180
+ streams['streams'].append({
181
+ 'title': channel['title'],
182
+ 'url': channel['url']
183
+ })
184
  if not streams['streams']:
185
  abort(404)
186
  return respond_with(streams)
 
227
 
228
  return respond_with({"meta": meta})
229
  if __name__ == '__main__':
230
+ app.run(host=HOST, port=PORT)