Spaces:
Paused
Paused
Update test.py
Browse files
test.py
CHANGED
|
@@ -15,16 +15,7 @@ def fetch_m3u8(url):
|
|
| 15 |
response.raise_for_status() # Raise an error for bad responses
|
| 16 |
return response.text
|
| 17 |
|
| 18 |
-
|
| 19 |
-
async def clone_m3u8():
|
| 20 |
-
try:
|
| 21 |
-
d = "https%3A//vixcloud.co/playlist/247057.m3u8%3Ftoken%3D58f1041398956749bec7b898b9ac7d81%26expires%3D1740340101%26h%3D1"
|
| 22 |
-
d = unquote(d)
|
| 23 |
-
m3u8_content = fetch_m3u8(d)
|
| 24 |
-
return Response(content=m3u8_content, media_type='application/vnd.apple.mpegurl')
|
| 25 |
-
except requests.RequestException as e:
|
| 26 |
-
print(f"Failed to fetch M3U8 file: {e}")
|
| 27 |
-
raise HTTPException(status_code=404, detail="M3U8 content not found")
|
| 28 |
@app.get("/clone/manifest.m3u8")
|
| 29 |
async def clone_m3u8(d: str = None):
|
| 30 |
if d:
|
|
|
|
| 15 |
response.raise_for_status() # Raise an error for bad responses
|
| 16 |
return response.text
|
| 17 |
|
| 18 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
@app.get("/clone/manifest.m3u8")
|
| 20 |
async def clone_m3u8(d: str = None):
|
| 21 |
if d:
|