Spaces:
Paused
Paused
Update epg.py
Browse files
epg.py
CHANGED
|
@@ -36,7 +36,7 @@ tivu = {
|
|
| 36 |
"rai-4k": "3407",
|
| 37 |
"""
|
| 38 |
convert_bho_1 = {
|
| 39 |
-
"euronews": "
|
| 40 |
"cartoonito": "cartoonito",
|
| 41 |
"sky-tg-24": "skytg24",
|
| 42 |
"frisbee": "frisbee",
|
|
@@ -158,19 +158,25 @@ async def tivu_get(id):
|
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
-
async def epg_guide(id
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
|
| 175 |
|
| 176 |
|
|
|
|
| 36 |
"rai-4k": "3407",
|
| 37 |
"""
|
| 38 |
convert_bho_1 = {
|
| 39 |
+
"euronews": "PlutoEuronews.it",
|
| 40 |
"cartoonito": "cartoonito",
|
| 41 |
"sky-tg-24": "skytg24",
|
| 42 |
"frisbee": "frisbee",
|
|
|
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
+
async def epg_guide(id):
|
| 162 |
+
try:
|
| 163 |
+
async with httpx.AsyncClient() as client:
|
| 164 |
+
if id in convert_bho_1:
|
| 165 |
+
id = convert_bho_1[id]
|
| 166 |
+
response = await client.get(f"https://lorempizza-boh.hf.space/{id}/now")
|
| 167 |
+
elif id in convert_bho_2:
|
| 168 |
+
id = convert_bho_2[id]
|
| 169 |
+
response = await client.get(f"https://mammamia-urlo-boh2.hf.space/{id}/now")
|
| 170 |
+
data = response.json()
|
| 171 |
+
description = data['description'].replace("- EPG by epg-guide.com","").replace("No description","")
|
| 172 |
+
title = data['title']
|
| 173 |
+
print(description,title)
|
| 174 |
+
return description,title
|
| 175 |
+
except Exception as e:
|
| 176 |
+
print(e)
|
| 177 |
+
description = f'Watch {id}'
|
| 178 |
+
title = ""
|
| 179 |
+
return description,title
|
| 180 |
|
| 181 |
|
| 182 |
|