added meta

This commit is contained in:
UrloMythus
2024-07-16 16:33:30 +02:00 Unverified
parent 5a8ad2f6d4
commit 8964a07b0f
2 changed files with 25 additions and 4 deletions
+24 -1
View File
@@ -25,7 +25,7 @@ MANIFEST = {
"catalogs": [ "catalogs": [
{"type": "tv", "id": "tv_channels", "name": "TV Channels"} {"type": "tv", "id": "tv_channels", "name": "TV Channels"}
], ],
"resources": ["stream", "catalog"], "resources": ["stream", "catalog","meta"],
"types": ["movie", "series", "tv"], "types": ["movie", "series", "tv"],
"name": "Mamma Mia", "name": "Mamma Mia",
"description": "Addon providing HTTPS Stream for Italian Movies/Series", "description": "Addon providing HTTPS Stream for Italian Movies/Series",
@@ -184,5 +184,28 @@ def addon_stream(type, id):
return respond_with(streams) 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__': if __name__ == '__main__':
app.run(host=HOST, port=PORT) app.run(host=HOST, port=PORT)
+1 -3
View File
@@ -177,6 +177,4 @@ def streaming_community(imdb):
print(url) print(url)
return url return url
except Exception as e: except Exception as e:
print("Nope It failed") print("Nope It failed")
streaming_community("tt0158552:3:2")