From fb0a9f51c3c719ceda3ada03fa2171b4dc26ea69 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 3 Sep 2023 10:05:44 +0800 Subject: updated --- index.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'index.py') diff --git a/index.py b/index.py index 6c10480..f54c216 100644 --- a/index.py +++ b/index.py @@ -1,10 +1,10 @@ from flask import Flask, request import requests -app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 - app = Flask(__name__) +app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 + # Set up the necessary variables token = "MTE0MTM0MDA2Mzk2ODU0MjczMA.GX75jG.frFFekrXjqk1BrAuTftSYClt1ERQn8BY2FiZgg" channel_id = '1140989222556274721' @@ -24,7 +24,10 @@ def handle_post_request(): 'content': "cao" } requests.post(url, headers=header, data=dbug)#DEBUGGGG======= - message = request.get_data().decode('utf-8') + try: + message = request.get_data().decode('utf-8') + except UnicodeDecodeError: + message = request.get_data() requests.post(url, headers=header, data=dbug)#DEBUGGGG======= isFile = False -- cgit v1.2.3