ahmedJaafari commited on
Commit
5215aa8
1 Parent(s): 37285b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -31,13 +31,10 @@ def get_videos(URL, channel_id, pageToken=None, maxResults=20):
31
  def get_all_videos(URL, channel_id):
32
  videos = []
33
  pageToken = None
34
- while True:
35
- response = get_videos(URL, channel_id, pageToken)
36
- for item in response["items"][:20]:
37
- videos.append(item["id"]["videoId"])
38
- pageToken = response.get("nextPageToken")
39
- if not pageToken:
40
- break
41
  return videos
42
 
43
  def submit_video(video_url):
 
31
  def get_all_videos(URL, channel_id):
32
  videos = []
33
  pageToken = None
34
+ response = get_videos(URL, channel_id, pageToken)
35
+ for item in response["items"]:
36
+ videos.append(item["id"]["videoId"])
37
+ pageToken = response.get("nextPageToken")
 
 
 
38
  return videos
39
 
40
  def submit_video(video_url):