Mythus commited on
Commit
c6d4821
·
verified ·
1 Parent(s): 67218a7

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +31 -118
run.py CHANGED
@@ -39,92 +39,13 @@ MANIFEST = {
39
  "logo": "https://creazilla-store.fra1.digitaloceanspaces.com/emojis/49647/pizza-emoji-clipart-md.png"
40
  }
41
 
42
- STREAMS = {
43
- "tv": {
44
- "skysport24": [
45
- {
46
- "title": "Sky Sport 24",
47
- "poster": f"https://www.tanti.{TF_DOMAIN}/public/upload/channel/sky-sport-24.webp",
48
- "url": "https://07-24.mizhls.ru/fls/cdn/calcioXskysport24/playlist.m3u8",
49
- "behaviorHints": {
50
- "notWebReady": True,
51
- "proxyHeaders": {
52
- "request": {
53
- "Referer": "https://claplivehdplay.ru/",
54
- "Origin": "https://claplivehdplay.ru",
55
- "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
56
- }
57
- }
58
- }
59
- }
60
- ],
61
- "Skyuno": [
62
- {
63
- "title": "Sky Uno",
64
- "poster": f"https://www.tanti.{TF_DOMAIN}/public/upload/channel/sky-uno.webp",
65
- "url": "https://07-24.mizhls.ru/fls/cdn/calcioXskyuno/playlist.m3u8",
66
- "behaviorHints": {
67
- "notWebReady": True,
68
- "proxyHeaders": {
69
- "request": {
70
- "Referer": "https://claplivehdplay.ru/",
71
- "Origin": "https://claplivehdplay.ru",
72
- "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
73
- }
74
- }
75
- }
76
- }
77
- ],
78
- "skyserie": [
79
- {
80
- "title": "Rai1",
81
- "poster": f"https://www.tanti.{TF_DOMAIN}/public/upload/channel/sky-serie.webp",
82
- "url": "http://mediapolis.rai.it/relinker/relinkerServlet.htm?cont=2606803&output=7&forceUserAgent=raiplayappletv",
83
- }
84
- ],
85
- "Sky Nature": [
86
- {
87
- "title": "Sky Nature",
88
- "poster": f"https://www.tanti.{TF_DOMAIN}/public/upload/channel/sky-nature.webp",
89
- "url": "https://07-24.mizhls.ru/fls/cdn/calcioXskynature/playlist.m3u8",
90
- "behaviorHints": {
91
- "notWebReady": True,
92
- "proxyHeaders": {
93
- "request": {
94
- "Referer": "https://claplivehdplay.ru/",
95
- "Origin": "https://claplivehdplay.ru",
96
- "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
97
- }
98
- }
99
- }
100
- }
101
- ],
102
- "skyinvestigation": [
103
- {
104
- "title": "skyinvestigation",
105
- "poster": f"https://www.tanti.{TF_DOMAIN}/public/upload/channel/sky-nature.webp",
106
- "url": "https://07-24.mizhls.ru/fls/cdn/calcioXskyinvestigation/playlist.m3u8",
107
- "behaviorHints": {
108
- "notWebReady": True,
109
- "proxyHeaders": {
110
- "request": {
111
- "Referer": "https://claplivehdplay.ru/",
112
- "Origin": "https://claplivehdplay.ru",
113
- "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
114
- }
115
- }
116
- }
117
- }
118
- ],
119
- "mediaset": [
120
- {
121
- "title": "la7",
122
- "poster": f"https://search.bus-hit.me/image_proxy?url=https%3A%2F%2Fduckduckgo.com%2Fi%2F7bd81676e0750f87.png&h=b3189a32959b14dc61a9d89451eea64ad6a85bfb3fe803693189e5ce06acef1f",
123
- "url": "https://d3749synfikwkv.cloudfront.net/v1/master/3722c60a815c199d9c0ef36c5b73da68a62b09d1/cc-74ylxpgd78bpb/Live.m3u8",
124
- }
125
- ]
126
- }
127
- }
128
 
129
  def respond_with(data):
130
  resp = jsonify(data)
@@ -140,22 +61,18 @@ def addon_manifest():
140
  def root():
141
  return "Hello, this is a Stremio Addon providing HTTPS Stream for Italian Movies/Series, to install it add /manifest.json to the url and then add it into the Stremio search bar"
142
 
143
- @app.route('/catalog/<type>/<id>.json')
144
- def addon_catalog(type, id):
145
- if type not in MANIFEST['types']:
146
- abort(404)
147
- catalog = {'metas': []}
148
- if type in STREAMS:
149
- for stream_id in STREAMS[type]:
150
- for item in STREAMS[type][stream_id]:
151
- meta_item = {
152
- "id": stream_id,
153
- "type": type,
154
- "name": item['title'],
155
- "poster": item.get('poster', "https://via.placeholder.com/150")
156
- }
157
- catalog['metas'].append(meta_item)
158
- return respond_with(catalog)
159
 
160
  @app.route('/stream/<type>/<id>.json')
161
  def addon_stream(type, id):
@@ -197,24 +114,20 @@ def addon_stream(type, id):
197
 
198
  @app.route('/meta/<type>/<id>.json')
199
  def meta(type, id):
200
- if type not in MANIFEST['types']:
201
  abort(404)
202
 
203
- meta = {}
204
- for stream_id in STREAMS.get(type, {}):
205
- if stream_id == id:
206
- item = STREAMS[type][stream_id][0] # Assuming there's at least one item
207
- meta = {
208
- "id": stream_id,
209
- "type": type,
210
- "name": item['title'],
211
- "poster": item.get('poster', "https://icons.iconarchive.com/icons/designbolts/free-multimedia/256/TV-icon.png"),
212
- "background": item.get('background', "https://icons.iconarchive.com/icons/designbolts/free-multimedia/256/TV-icon.png")
213
- }
214
- break
215
-
216
- if not meta:
217
- abort(404)
218
 
219
  return respond_with({"meta": meta})
220
  if __name__ == '__main__':
 
39
  "logo": "https://creazilla-store.fra1.digitaloceanspaces.com/emojis/49647/pizza-emoji-clipart-md.png"
40
  }
41
 
42
+
43
+ TV_CHANNELS = [
44
+ {"id": "channel1", "name": "Channel 1", "url": "https://d3749synfikwkv.cloudfront.net/v1/master/3722c60a815c199d9c0ef36c5b73da68a62b09d1/cc-74ylxpgd78bpb/Live.m3u8"},
45
+ {"id": "channel2", "name": "Channel 2", "url": "http://mediapolis.rai.it/relinker/relinkerServlet.htm?cont=2606803&output=7&forceUserAgent=raiplayappletv"},
46
+ # Add more channels as required
47
+ ]
48
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
  def respond_with(data):
51
  resp = jsonify(data)
 
61
  def root():
62
  return "Hello, this is a Stremio Addon providing HTTPS Stream for Italian Movies/Series, to install it add /manifest.json to the url and then add it into the Stremio search bar"
63
 
64
+ # Catalog route
65
+ @app.route('/catalog/tv_channels.json')
66
+ def catalog():
67
+ items = []
68
+ for channel in TV_CHANNELS:
69
+ items.append({
70
+ "id": channel["id"],
71
+ "name": channel["name"],
72
+ "type": "channel"
73
+ })
74
+
75
+ return respond_with({"metas": items})
 
 
 
 
76
 
77
  @app.route('/stream/<type>/<id>.json')
78
  def addon_stream(type, id):
 
114
 
115
  @app.route('/meta/<type>/<id>.json')
116
  def meta(type, id):
117
+ if type != "channel":
118
  abort(404)
119
 
120
+ for channel in TV_CHANNELS:
121
+ if channel["id"] == id:
122
+ return respond_with({
123
+ "meta": {
124
+ "id": channel["id"],
125
+ "name": channel["name"],
126
+ "type": "channel"
127
+ }
128
+ })
129
+
130
+ abort(404)
 
 
 
 
131
 
132
  return respond_with({"meta": meta})
133
  if __name__ == '__main__':