Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import random
|
| 2 |
from fastapi import FastAPI, HTTPException
|
| 3 |
-
import
|
| 4 |
|
| 5 |
app = FastAPI()
|
| 6 |
def randomer():
|
|
@@ -310,13 +310,12 @@ async def root():
|
|
| 310 |
return {"message": "Welcome to dailymo requestor"}
|
| 311 |
@app.get("/fetcher/")
|
| 312 |
async def fetcher():
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
raise HTTPException(status_code=e.response.status_code, detail=str(e))
|
| 321 |
|
| 322 |
|
|
|
|
| 1 |
import random
|
| 2 |
from fastapi import FastAPI, HTTPException
|
| 3 |
+
import requests
|
| 4 |
|
| 5 |
app = FastAPI()
|
| 6 |
def randomer():
|
|
|
|
| 310 |
return {"message": "Welcome to dailymo requestor"}
|
| 311 |
@app.get("/fetcher/")
|
| 312 |
async def fetcher():
|
| 313 |
+
|
| 314 |
+
url = "https://dailymo1.onrender.com/getf/?videourl="+randomer()
|
| 315 |
+
|
| 316 |
+
response = requests.get(url)
|
| 317 |
+
# Raises an HTTPError for bad responses
|
| 318 |
+
return response.text
|
| 319 |
+
|
|
|
|
| 320 |
|
| 321 |
|