Fixed Support for Web Version for Live TV

This commit is contained in:
UrloMythus
2024-08-27 15:11:03 +02:00 Unverified
parent d4984e71d3
commit 4342cbbf8b
+23 -26
View File
@@ -80,32 +80,29 @@ def addon_catalog(type, id):
return respond_with(catalogs) return respond_with(catalogs)
@app.get('/meta/{type}/{id}.json') @app.get('/meta/tv/{id}.json')
def addon_meta(type, id): def addon_meta(id: str):
if type != "tv": # Find the channel by ID
raise HTTPException(status_code=404) channel = next((ch for ch in STREAM['channels'] if ch['id'] == id), None)
for channel in STREAM["channels"]: if not channel:
if channel["id"] == id: raise HTTPException(status_code=404, detail="Channel not found")
meta = {
"id": id, meta = {
"type": "tv", 'meta': {
"name": channel["title"], 'id': channel['id'],
"poster": channel["poster"], # Add poster URL if available 'type': 'tv',
"description": f"Watch {channel['title']}", 'name': channel['name'],
"background": "", # Add background image URL if available 'poster': channel['poster'],
"logo": "", # Add logo URL if available 'posterShape': 'landscape',
"videos": [{ 'description': channel['title'],
"title": channel["title"], # Additional fields can be added here
"streams": [{ 'background': channel['poster'], # Example of using the same poster as background
"title": channel["title"], 'logo': channel['poster'], # Example of using the same poster as logo
"url": channel["url"] 'url': channel['url'], # Using the stream URL as a website link
}] }
}] }
} return respond_with(meta)
return respond_with({"meta": meta})
raise HTTPException(status_code=404)
@app.get('/stream/{type}/{id}.json') @app.get('/stream/{type}/{id}.json')