From 8964a07b0f60613b961aaeb6ade48c5293073c0d Mon Sep 17 00:00:00 2001 From: UrloMythus Date: Tue, 16 Jul 2024 16:33:30 +0200 Subject: [PATCH] added meta --- run.py | 25 ++++++++++++++++++++++++- streamingcommunity.py | 4 +--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/run.py b/run.py index 5f76a0a..fd8a3f6 100644 --- a/run.py +++ b/run.py @@ -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//.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) diff --git a/streamingcommunity.py b/streamingcommunity.py index e33f625..284c261 100644 --- a/streamingcommunity.py +++ b/streamingcommunity.py @@ -177,6 +177,4 @@ def streaming_community(imdb): print(url) return url except Exception as e: - print("Nope It failed") - -streaming_community("tt0158552:3:2") \ No newline at end of file + print("Nope It failed") \ No newline at end of file