diff --git a/TikTokLive/client/client.py b/TikTokLive/client/client.py index ceb74df..2c40163 100644 --- a/TikTokLive/client/client.py +++ b/TikTokLive/client/client.py @@ -65,6 +65,9 @@ def __init__( level=LogLevel.ERROR ) + # Overridable properties + self.ignore_broken_payload: bool = False + # Properties self._unique_id: str = self.parse_unique_id(unique_id) self._room_id: Optional[int] = None @@ -359,7 +362,8 @@ def _parse_webcast_response(self, response: Optional[WebcastResponseMessage]) -> try: proto_event: ProtoEvent = event_type().parse(response.payload) except Exception: - self._logger.error(traceback.format_exc() + "\nBroken Payload:\n" + str(response.payload)) + if not self.ignore_broken_payload: + self._logger.error(traceback.format_exc() + "\nBroken Payload:\n" + str(response.payload)) return [response_event] parsed_events: List[Event] = [response_event, proto_event]