Mythus commited on
Commit
8c91fbf
·
verified ·
1 Parent(s): 75f07a8

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +8 -6
run.py CHANGED
@@ -120,24 +120,26 @@ def addon_stream(type, id):
120
 
121
  @app.route('/meta/<type>/<id>.json')
122
  def meta(type, id):
123
- # This route gets the metadata of a channel
124
- # `type` should be "tv", and `id` should be the id of the channel (like "channel1")
125
-
126
- if type != "tv":
127
  abort(404)
128
 
129
- channel = STREAMS.get(type, {}).get(id)
130
  if channel:
131
  return respond_with({
132
  "meta": {
133
  "id": id,
134
  "name": channel["name"],
135
- "type": "channel"
 
 
 
 
136
  }
137
  })
138
 
139
  abort(404)
140
 
 
141
  return respond_with({"meta": meta})
142
  if __name__ == '__main__':
143
  app.run(host=HOST, port=PORT)
 
120
 
121
  @app.route('/meta/<type>/<id>.json')
122
  def meta(type, id):
123
+ if type != "channel": # Change this to "channel"
 
 
 
124
  abort(404)
125
 
126
+ channel = STREAMS.get("tv", {}).get(id) # Change the type here to "tv"
127
  if channel:
128
  return respond_with({
129
  "meta": {
130
  "id": id,
131
  "name": channel["name"],
132
+ "type": "channel",
133
+ "poster": channel.get("poster", ""), # Add this line if you have a poster for each channel
134
+ "background": channel.get("background", ""), # Add this line if you have a background for each channel
135
+ "logo": channel.get("logo", ""), # Add this line if you have a logo for each channel
136
+ # Add more fields as required
137
  }
138
  })
139
 
140
  abort(404)
141
 
142
+
143
  return respond_with({"meta": meta})
144
  if __name__ == '__main__':
145
  app.run(host=HOST, port=PORT)