Update app.py
Browse files
app.py
CHANGED
|
@@ -84,10 +84,10 @@ def downloadTubeUpload(query):
|
|
| 84 |
print('1=>', search_response)
|
| 85 |
# Step 2: Find the first video with duration less than 10 minutes and extract its ID
|
| 86 |
video_id = None
|
| 87 |
-
search_response = sorted(search_response, key=lambda x: x["views"], reverse=True)
|
| 88 |
for item in search_response:
|
| 89 |
duration = item.get("duration_raw")
|
| 90 |
-
if duration and len(duration.split(':'))< 3 and int(duration.split(':')[
|
| 91 |
video_id = item.get("id", {}).get("videoId")
|
| 92 |
break
|
| 93 |
print('1-r',video_id)
|
|
|
|
| 84 |
print('1=>', search_response)
|
| 85 |
# Step 2: Find the first video with duration less than 10 minutes and extract its ID
|
| 86 |
video_id = None
|
| 87 |
+
#search_response = sorted(search_response, key=lambda x: x["views"], reverse=True)
|
| 88 |
for item in search_response:
|
| 89 |
duration = item.get("duration_raw")
|
| 90 |
+
if duration and len(duration.split(':'))< 3 and int(duration.split(':')[0])<5:
|
| 91 |
video_id = item.get("id", {}).get("videoId")
|
| 92 |
break
|
| 93 |
print('1-r',video_id)
|