This repository was archived by the owner on Oct 31, 2022. It is now read-only.
File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ def check_stock():
104
104
extract_categories ()
105
105
flag = False
106
106
msg = ""
107
- with open ("all_categories_formatted.json" ) as f :
107
+ with open ("all_categories_formatted.json" , encoding = 'utf-8' ) as f :
108
108
flag = False
109
109
all_categories = json .load (f )
110
110
Original file line number Diff line number Diff line change @@ -19,13 +19,14 @@ def check_home():
19
19
res = r .json ()
20
20
if res ['code' ] == 0 :
21
21
find = r .text .find (config .key_word )
22
- params = {'group' : '叮咚买菜' }
23
22
print (r .text )
24
23
if find > 0 :
25
24
print ('还没有运力!' , time .strftime ("%Y-%m-%d %H:%M:%S" , time .localtime ()))
26
25
else :
27
26
txt = '叮咚买菜有运力啦!!!'
28
27
send_msg_bark (txt )
28
+ else :
29
+ print ('请求异常' , r .text )
29
30
30
31
31
32
# 检查购物车 需要cookie
@@ -59,7 +60,6 @@ def check_cart():
59
60
print (res )
60
61
if res ['code' ] == 0 :
61
62
reserve_times = res ['data' ][0 ]['time' ][0 ]['times' ]
62
- params = {'group' : '叮咚买菜' }
63
63
all_full = True
64
64
for reserve_time in reserve_times :
65
65
all_full = all_full and reserve_time ['fullFlag' ]
@@ -70,6 +70,8 @@ def check_cart():
70
70
print ('还没有可预约时间!' )
71
71
else :
72
72
print ('请求异常!' )
73
+ else :
74
+ print ('请求异常' , r .text )
73
75
74
76
75
77
def run ():
You can’t perform that action at this time.
0 commit comments