diff options
author | Sergey M․ <dstftw@gmail.com> | 2018-08-12 01:52:50 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2018-08-12 01:52:50 +0700 |
commit | de4c41b437c7a0126074d75ddeeccbf4470d0684 (patch) | |
tree | b849725b6a2d46ad726a5c15f9b2d3c4f6727e4d /youtube_dl | |
parent | b65e3b0636c4b992f3187bff7d5268c6891023a6 (diff) |
[bitchute] Improve page offset
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/bitchute.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/youtube_dl/extractor/bitchute.py b/youtube_dl/extractor/bitchute.py index 28016f18b..da263714a 100644 --- a/youtube_dl/extractor/bitchute.py +++ b/youtube_dl/extractor/bitchute.py @@ -81,14 +81,15 @@ class BitChuteChannelIE(InfoExtractor): def _entries(self, channel_id): channel_url = 'https://www.bitchute.com/channel/%s/' % channel_id - for page_num in itertools.count(0): + offset = 0 + for page_num in itertools.count(1): data = self._download_json( '%sextend/' % channel_url, channel_id, - 'Downloading channel page %d' % (page_num + 1), + 'Downloading channel page %d' % page_num, data=urlencode_postdata({ 'csrfmiddlewaretoken': self._TOKEN, 'name': '', - 'offset': page_num * 25 + 'offset': offset, }), headers={ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Referer': channel_url, @@ -105,6 +106,7 @@ class BitChuteChannelIE(InfoExtractor): html) if not video_ids: break + offset += len(video_ids) for video_id in video_ids: yield self.url_result( 'https://www.bitchute.com/video/%s' % video_id, |