mirror of
https://github.com/Yanyutin753/RefreshToV1Api.git
synced 2025-12-10 01:03:03 +08:00
🥳 修复data:结尾代码输出出现异常问题
This commit is contained in:
2
main.py
2
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)
|
||||
|
||||
Reference in New Issue
Block a user