mzltest commited on
Commit
319afd9
·
1 Parent(s): 6036957

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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(':')[1])<5:
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)