def get_channel_uploads_from_date2(self, yt_id, yt_date): items = [] next_page = True token = "" while next_page: request = self.youtube.search().list(part="snippet,id", channelId=yt_id, maxResults=MAX_RESULTS, order="date", publishedAfter=yt_date, pageToken=token) response = request.execute() File.append_to_file("debug.txt", response.get('items')) File.append_to_file("debug.txt", "") items += response.get('items') token = response.get('nextPageToken') if not response.get('items') or not token: next_page = False return items