Skip to content

Commit a3031c6

Browse files
authored
Update main.py
1 parent a338b61 commit a3031c6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,17 @@ def push(content):
6767
total_html = session.get(url = user_url,headers = header).text;
6868
total = re.findall('<span class="counter">(.*?)</span> GB', total_html, re.S);
6969
# 进行推送
70-
content = email + '\n签到前剩余总流量: ' + remain[0] + 'GB\n' + content + '\n当前剩余总流量: ' + total[0] + 'GB\n';
70+
content = email + '\n签到前剩余总流量: ' + remain[0] if len(remain) > 0 else "NULL " + 'GB\n' + content + '\n当前剩余总流量: ' + total[0] if len(total) > 0 else "NULL " + 'GB\n';
7171
#push(content)
7272
res += content
7373
except:
7474
total_html = session.get(url = user_url,headers = header).text;
7575
total = re.findall('<span class="counter">(.*?)</span> GB', total_html, re.S);
7676
print(email,passwd)
77-
content = email + ' 签到失败' + ',当前剩余总流量: ' + total + "GB\n"
77+
content = email + ' 签到失败' + ',当前剩余总流量: ' + total[0] if len(total) > 0 else "NULL " + "GB\n"
7878
print(content);
7979
#push(content);
8080
res += content
8181

8282
#最后统一推送
83-
push(res)
83+
push(res)

0 commit comments

Comments
 (0)