added meta

This commit is contained in:
UrloMythus
2024-07-16 16:33:30 +02:00 Unverified
parent 432fd26c3a
commit d42cb52e5b
2 changed files with 25 additions and 4 deletions
+24 -1
View File
@@ -25,7 +25,7 @@ MANIFEST = {
"catalogs": [
{"type": "tv", "id": "tv_channels", "name": "TV Channels"}
],
"resources": ["stream", "catalog"],
"resources": ["stream", "catalog","meta"],
"types": ["movie", "series", "tv"],
"name": "Mamma Mia",
"description": "Addon providing HTTPS Stream for Italian Movies/Series",
@@ -184,5 +184,28 @@ def addon_stream(type, id):
return respond_with(streams)
@app.route('/meta/<type>/<id>.json')
def addon_meta(type, id):
if type not in MANIFEST['types']:
abort(404)
meta = {}
for stream_id in STREAMS.get(type, {}):
if stream_id == id:
item = STREAMS[type][stream_id][0] # Assuming there's at least one item
meta = {
"id": stream_id,
"type": type,
"name": item['title'],
"poster": item.get('poster', "https://via.placeholder.com/150"),
"background": item.get('background', "https://via.placeholder.com/800x450")
}
break
if not meta:
abort(404)
return respond_with({"meta": meta})
if __name__ == '__main__':
app.run(host=HOST, port=PORT)