Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ async def handle_message(self, message_data, websocket):
logger.info(f'交易成功 {user_url} 等待卖家发货')
return

except:
except Exception:
pass

# 判断消息类型
Expand Down
6 changes: 3 additions & 3 deletions utils/xianyu_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def trans_cookies(cookies_str: str) -> Dict[str, str]:
parts = cookie.split('=', 1)
if len(parts) == 2:
cookies[parts[0]] = parts[1]
except:
except Exception:
continue
return cookies

Expand Down Expand Up @@ -312,7 +312,7 @@ def json_serializer(obj):
if isinstance(obj, bytes):
try:
return obj.decode('utf-8')
except:
except Exception:
return base64.b64encode(obj).decode('utf-8')
elif hasattr(obj, '__dict__'):
return obj.__dict__
Expand All @@ -326,7 +326,7 @@ def json_serializer(obj):
try:
text_result = decoded_bytes.decode('utf-8')
return json.dumps({"text": text_result})
except:
except Exception:
# 最后的备选方案:返回十六进制表示
hex_result = decoded_bytes.hex()
return json.dumps({"hex": hex_result, "error": f"Decode failed: {str(e)}"})
Expand Down