Update app.py
Browse files
app.py
CHANGED
@@ -539,7 +539,20 @@ def extract_video_info(video_url: str) -> str:
|
|
539 |
result.append(new_item)
|
540 |
return result
|
541 |
else:
|
542 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
543 |
else:
|
544 |
logger.warning(f"Request failed with status code {response.status_code}, API: {api_url}")
|
545 |
except Exception as e:
|
|
|
539 |
result.append(new_item)
|
540 |
return result
|
541 |
else:
|
542 |
+
if 'url' in json_response:
|
543 |
+
d_url = json_response.get('url')
|
544 |
+
t_url = json_response.get('thumbnail')
|
545 |
+
result.append({
|
546 |
+
"url": d_url,
|
547 |
+
"format_id": "video"
|
548 |
+
})
|
549 |
+
result.append({
|
550 |
+
"url": t_url,
|
551 |
+
"format_id": "thumbnail"
|
552 |
+
})
|
553 |
+
return result
|
554 |
+
else:
|
555 |
+
return {"error": "No formats available"}
|
556 |
else:
|
557 |
logger.warning(f"Request failed with status code {response.status_code}, API: {api_url}")
|
558 |
except Exception as e:
|