Update app.py
Browse files
app.py
CHANGED
@@ -200,12 +200,12 @@ class ApiRotator:
|
|
200 |
|
201 |
# In your function:
|
202 |
api_rotator = ApiRotator([
|
203 |
-
"http://34.107.254.11",
|
204 |
-
"https://cobalt-api.kwiatekmiki.com",
|
205 |
-
"http://2.56.214.74:9000",
|
206 |
"https://dwnld.nichind.dev",
|
|
|
207 |
"http://109.107.189.229:9000",
|
208 |
"https://chrunos-load.hf.space",
|
|
|
|
|
209 |
"https://cobalt-api.ayo.tf"
|
210 |
])
|
211 |
|
@@ -521,7 +521,7 @@ async def multi_download(request: Request):
|
|
521 |
else:
|
522 |
parameter = f'type=video&quality={quality}'
|
523 |
|
524 |
-
|
525 |
is_youtube_url = re.search(r'(youtube\.com|youtu\.be)', video_url) is not None
|
526 |
|
527 |
if is_youtube_url:
|
@@ -535,15 +535,16 @@ async def multi_download(request: Request):
|
|
535 |
}
|
536 |
|
537 |
else:
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
|
|
547 |
|
548 |
|
549 |
|
|
|
200 |
|
201 |
# In your function:
|
202 |
api_rotator = ApiRotator([
|
|
|
|
|
|
|
203 |
"https://dwnld.nichind.dev",
|
204 |
+
"http://34.107.254.11",
|
205 |
"http://109.107.189.229:9000",
|
206 |
"https://chrunos-load.hf.space",
|
207 |
+
"http://2.56.214.74:9000",
|
208 |
+
"https://cobalt-api.kwiatekmiki.com",
|
209 |
"https://cobalt-api.ayo.tf"
|
210 |
])
|
211 |
|
|
|
521 |
else:
|
522 |
parameter = f'type=video&quality={quality}'
|
523 |
|
524 |
+
'''
|
525 |
is_youtube_url = re.search(r'(youtube\.com|youtu\.be)', video_url) is not None
|
526 |
|
527 |
if is_youtube_url:
|
|
|
535 |
}
|
536 |
|
537 |
else:
|
538 |
+
'''
|
539 |
+
dl_url = await get_track_download_url(video_url, quality)
|
540 |
+
if dl_url:
|
541 |
+
remaining_requests_value = rate_limiter.max_requests - rate_limiter.get_current_count(user_ip)
|
542 |
+
dl_url["requests_remaining"] = remaining_requests_value
|
543 |
+
return dl_url
|
544 |
+
else:
|
545 |
+
return {
|
546 |
+
"error": "Failed to Fetch the video."
|
547 |
+
}
|
548 |
|
549 |
|
550 |
|