Update app.py
Browse files
app.py
CHANGED
@@ -281,6 +281,7 @@ EXTRACT_API = os.getenv("EXTRACT_API")
|
|
281 |
|
282 |
async def extract_video_info(video_url: str) -> str:
|
283 |
api_url = f'{EXTRACT_API}?url={video_url}'
|
|
|
284 |
session = cloudscraper.create_scraper()
|
285 |
try:
|
286 |
response = session.get(api_url, timeout=20)
|
@@ -303,7 +304,7 @@ async def extract_video_info(video_url: str) -> str:
|
|
303 |
else:
|
304 |
return {"error": "No formats available"}
|
305 |
else:
|
306 |
-
return {"error": f"Request failed with status code {response.status_code}"}
|
307 |
except Exception as e:
|
308 |
logger.error(f"An error occurred: {e}")
|
309 |
return {"error": str(e)}
|
|
|
281 |
|
282 |
async def extract_video_info(video_url: str) -> str:
|
283 |
api_url = f'{EXTRACT_API}?url={video_url}'
|
284 |
+
logger.info(api_url)
|
285 |
session = cloudscraper.create_scraper()
|
286 |
try:
|
287 |
response = session.get(api_url, timeout=20)
|
|
|
304 |
else:
|
305 |
return {"error": "No formats available"}
|
306 |
else:
|
307 |
+
return {"error": f"Request failed with status code {response.status_code}, API: {api_url}"}
|
308 |
except Exception as e:
|
309 |
logger.error(f"An error occurred: {e}")
|
310 |
return {"error": str(e)}
|