- return self.playlist_result(entries, show_id, title, description)
+ entries = []
+ for video_type in ('episodes', 'clips'):
+ page_url = '%s/%s/%s.json?app=%s&per_page=%d&sort=number&direction=asc&with_paging=true&page=1' % (self._API_BASE, channel_id, video_type, self._APP, self._PER_PAGE)
+ while page_url:
+ page = self._download_json(
+ page_url, channel_id,
+ 'Downloading %s JSON page #%s'
+ % (video_type, re.search(r'[?&]page=([0-9]+)', page_url).group(1)))
+ for video in page['response']:
+ video_id = video['id']
+ entries.append(self.url_result(
+ 'http://www.viki.com/videos/%s' % video_id, 'Viki', video_id))
+ page_url = page['pagination']['next']
+
+ return self.playlist_result(entries, channel_id, title, description)