Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
Change to download now works without a limit again.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jabb0 committed Nov 28, 2020
1 parent acb4a8a commit f9460f7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions psaw/PushshiftAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,16 @@ def _handle_paging(self, url):

data = self._get(url, self.payload)
yield data
received_size = int(data['metadata']['size'])
requested_size = self.payload['limit']
# Apparently the API can decide to send less data than desired. We need to send another request in that case
if received_size < requested_size:
limit += requested_size - received_size

if (limit is not None) and (limit == 0):
return
if limit is not None:
received_size = int(data['metadata']['size'])
requested_size = self.payload['limit']
# The API can decide to send less data than desired.
# We need to send another request in that case requesting the missing amount
if received_size < requested_size:
limit += requested_size - received_size

if limit == 0:
return

def _search(self,
kind,
Expand Down

0 comments on commit f9460f7

Please sign in to comment.