- next_url = None
-
- for i in itertools.count():
- if not next_url:
- query['offset'] = i * results_per_page
- data = compat_urllib_parse.urlencode(query)
- next_url = '{0}{1}?{2}'.format(
- self._API_V2_BASE, endpoint, data)
-
- response = self._download_json(next_url,
- video_id=collection_id,
- note='Downloading page {0}'.format(i+1),
- errnote='Unable to download API page')
+ for i in itertools.count(1):
+ response = self._download_json(
+ next_url, collection_id, 'Downloading page {0}'.format(i),
+ 'Unable to download API page')