diff options
| author | mrdog233o5 <mr.dog233o5@gmail.com> | 2023-09-03 20:30:43 +0800 |
|---|---|---|
| committer | mrdog233o5 <mr.dog233o5@gmail.com> | 2023-09-03 20:30:43 +0800 |
| commit | 77787c09ff7d28469ddb16bf3640f0888da448bf (patch) | |
| tree | d7774f466478df8b79f5b210d97f54667b80e697 | |
| parent | fb0a9f51c3c719ceda3ada03fa2171b4dc26ea69 (diff) | |
cao finally2
| -rw-r--r-- | index.py | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -3,7 +3,10 @@ import requests app = Flask(__name__) -app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 +app.config.update( + DEBUG=True, + MAX_CONTENT_LENGTH=20*1024*1024 +) # Set up the necessary variables token = "MTE0MTM0MDA2Mzk2ODU0MjczMA.GX75jG.frFFekrXjqk1BrAuTftSYClt1ERQn8BY2FiZgg" @@ -20,22 +23,16 @@ old_message = "" @app.route('/', methods=['POST']) def handle_post_request(): global old_message - dbug= { - 'content': "cao" - } - requests.post(url, headers=header, data=dbug)#DEBUGGGG======= try: message = request.get_data().decode('utf-8') except UnicodeDecodeError: message = request.get_data() - requests.post(url, headers=header, data=dbug)#DEBUGGGG======= isFile = False if message.split(maxsplit = 1)[0] == "FILE": isFile = True # Check if the message is different from the previous one - requests.post(url, headers=header, data=dbug)#DEBUGGGG======= if message != old_message: payload = { @@ -55,10 +52,8 @@ def handle_post_request(): "file" : (file[0],file[1]) # The picture that we want to send in binary } - requests.post(url, headers=header, data=dbug)#DEBUGGGG======= response = requests.post(url, headers=header, data=payload, files=files) - requests.post(url, headers=header, data=dbug)#DEBUGGGG======= else: response = requests.post(url, headers=header, data=payload) |
