Update app.py
Browse files
app.py
CHANGED
|
@@ -223,7 +223,7 @@ async def get_track_download_url(video_url: str) -> str:
|
|
| 223 |
response = session.post(
|
| 224 |
api_url,
|
| 225 |
timeout=20,
|
| 226 |
-
json={"url": y_url, "videoQuality": "720"},
|
| 227 |
headers=headers
|
| 228 |
)
|
| 229 |
logger.info(f"Response status: {response.status_code}")
|
|
@@ -309,7 +309,7 @@ async def download_high_quality_video(request: Request):
|
|
| 309 |
if is_youtube_url:
|
| 310 |
dl_url = await get_track_download_url(video_url)
|
| 311 |
if dl_url and "http" in dl_url:
|
| 312 |
-
return {"url": dl_url}
|
| 313 |
else:
|
| 314 |
return {
|
| 315 |
"error": "Failed to Fetch the video."
|
|
|
|
| 223 |
response = session.post(
|
| 224 |
api_url,
|
| 225 |
timeout=20,
|
| 226 |
+
json={"url": y_url, "videoQuality": "720", "filenameStyle": "pretty"},
|
| 227 |
headers=headers
|
| 228 |
)
|
| 229 |
logger.info(f"Response status: {response.status_code}")
|
|
|
|
| 309 |
if is_youtube_url:
|
| 310 |
dl_url = await get_track_download_url(video_url)
|
| 311 |
if dl_url and "http" in dl_url:
|
| 312 |
+
return {"url": dl_url, "requests_remaining": "rate_limiter.max_requests - rate_limiter.get_current_count(user_ip)"}
|
| 313 |
else:
|
| 314 |
return {
|
| 315 |
"error": "Failed to Fetch the video."
|