Spaces:
Paused
Paused
Update run.py
Browse files
run.py
CHANGED
|
@@ -78,31 +78,30 @@ def addon_catalog(type, id):
|
|
| 78 |
"description": f"Watch {channel['title']}"
|
| 79 |
})
|
| 80 |
return respond_with(catalogs)
|
| 81 |
-
|
| 82 |
-
@app.get('/meta/
|
| 83 |
-
def addon_meta(
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
raise HTTPException(status_code=404)
|
| 106 |
|
| 107 |
|
| 108 |
@app.get('/stream/{type}/{id}.json')
|
|
|
|
| 78 |
"description": f"Watch {channel['title']}"
|
| 79 |
})
|
| 80 |
return respond_with(catalogs)
|
| 81 |
+
|
| 82 |
+
@app.get('/meta/tv/{id}.json')
|
| 83 |
+
def addon_meta(id: str):
|
| 84 |
+
# Find the channel by ID
|
| 85 |
+
channel = next((ch for ch in STREAM['channels'] if ch['id'] == id), None)
|
| 86 |
+
|
| 87 |
+
if not channel:
|
| 88 |
+
raise HTTPException(status_code=404, detail="Channel not found")
|
| 89 |
+
|
| 90 |
+
meta = {
|
| 91 |
+
'meta': {
|
| 92 |
+
'id': channel['id'],
|
| 93 |
+
'type': 'tv',
|
| 94 |
+
'name': channel['name'],
|
| 95 |
+
'poster': channel['poster'],
|
| 96 |
+
'posterShape': 'landscape',
|
| 97 |
+
'description': channel['title'],
|
| 98 |
+
# Additional fields can be added here
|
| 99 |
+
'background': channel['poster'], # Example of using the same poster as background
|
| 100 |
+
'logo': channel['poster'], # Example of using the same poster as logo
|
| 101 |
+
'url': channel['url'], # Using the stream URL as a website link
|
| 102 |
+
}
|
| 103 |
+
}
|
| 104 |
+
return respond_with(meta)
|
|
|
|
| 105 |
|
| 106 |
|
| 107 |
@app.get('/stream/{type}/{id}.json')
|