diff --git a/twarc/client2.py b/twarc/client2.py index 5bcbc5d3..ffb6f0ea 100644 --- a/twarc/client2.py +++ b/twarc/client2.py @@ -438,7 +438,7 @@ def sample(self, event=None, record_keepalive=False): generator[dict]: a generator, dict for each tweet. """ url = "https://api.twitter.com/2/tweets/sample/stream" - while True: + while catch_request_exceptions(lambda: True): log.info("Connecting to V2 sample stream") resp = self.get(url, params=expansions.EVERYTHING.copy(), stream=True) for line in resp.iter_lines(chunk_size=512): @@ -533,7 +533,7 @@ def stream(self, event=None, record_keep_alives=False): url = "https://api.twitter.com/2/tweets/search/stream" params = expansions.EVERYTHING.copy() - while True: + while catch_request_exceptions(lambda: True): log.info("Connecting to V2 stream") resp = self.get(url, params=params, stream=True) for line in resp.iter_lines(): @@ -557,6 +557,7 @@ def stream(self, event=None, record_keep_alives=False): if self._check_for_disconnect(data): break + def _timeline( self, user_id, diff --git a/twarc/version.py b/twarc/version.py index 45ed69f9..8f36c130 100644 --- a/twarc/version.py +++ b/twarc/version.py @@ -1 +1 @@ -version = "2.3.7" +version = "2.3.8"