修复超值福利签到失败导致的错误

This commit is contained in:
2024-09-28 14:51:17 +08:00 committed by GitHub
parent 06468e0e46
commit f40a4d2a70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

25
SFSY.py
View File

@ -165,17 +165,20 @@ class RUN:
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberActLengthy~redPacketActivityService~superWelfare~receiveRedPacket' url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberActLengthy~redPacketActivityService~superWelfare~receiveRedPacket'
response = self.do_request(url, data=json_data) response = self.do_request(url, data=json_data)
# print(response) # print(response)
if response.get('success') == True: try:
gift_list = response.get('obj', {}).get('giftList', []) if response.get('success') == True:
if response.get('obj', {}).get('extraGiftList', []): gift_list = response.get('obj', {}).get('giftList', [])
gift_list.extend(response['obj']['extraGiftList']) if response.get('obj', {}).get('extraGiftList', []):
gift_names = ', '.join([gift['giftName'] for gift in gift_list]) gift_list.extend(response['obj']['extraGiftList'])
receive_status = response.get('obj', {}).get('receiveStatus') gift_names = ', '.join([gift['giftName'] for gift in gift_list])
status_message = '领取成功' if receive_status == 1 else '已领取过' receive_status = response.get('obj', {}).get('receiveStatus')
Log(f'超值福利签到[{status_message}]: {gift_names}') status_message = '领取成功' if receive_status == 1 else '已领取过'
else: Log(f'超值福利签到[{status_message}]: {gift_names}')
error_message = response.get('errorMessage') or json.dumps(response) or '无返回' else:
print(f'超值福利签到失败: {error_message}') error_message = response.get('errorMessage') or json.dumps(response) or '无返回'
print(f'超值福利签到失败: {error_message}')
except Exception as e:
print(f'超值福利签到失败: {e}')
def get_SignTaskList(self, END=False): def get_SignTaskList(self, END=False):
if not END: print(f'>>>开始获取签到任务列表') if not END: print(f'>>>开始获取签到任务列表')