diff --git a/main.py b/main.py index c4cc15d..a43cacf 100644 --- a/main.py +++ b/main.py @@ -1301,7 +1301,7 @@ def data_fetcher(upstream_response, data_queue, stop_event, last_data_time, api_ end_index = buffer.index('\n\n') + 2 complete_data, buffer = buffer[:end_index], buffer[end_index:] try: - data_content = complete_data.replace('data: ', '').strip() + data_content = re.sub(r'^data:\s*', '', complete_data).strip() if not data_content: continue data_json = json.loads(data_content)