diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index e800aa1..282bee4 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -78,7 +78,7 @@ jobs: - name: Flet Build macOS (x86_64) run: | - flet pack --name GetQzonehistory-latest main.py -i .\assets\icon.ico + flet pack --name GetQzonehistory-latest main.py -i ./assets/icon.ico - name: Zip the macOS (x86_64) build run: | diff --git a/main.py b/main.py index 6b4f98c..54bdc9c 100644 --- a/main.py +++ b/main.py @@ -17,9 +17,7 @@ import traceback import dateparser import hashlib import copy -from fake_useragent import UserAgent -ua = UserAgent() # 程序版本 version = "1.0.2" @@ -68,7 +66,7 @@ headers = { 'sec-fetch-user': '?1', 'upgrade-insecure-requests': '1', # Temporarily fix waf issues - 'user-agent': ua.random, + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0', } @@ -1051,6 +1049,7 @@ def main(page: ft.Page): ) def get_message(start, count): + global is_stop for i in range(5): if i == 4: log("请求频繁,换个时间再试吧", "ERROR") @@ -1236,7 +1235,7 @@ def main(page: ft.Page): # 完成消息获取 content_area.content.clean() if is_stop: - log("获取失败,换个时间再来吧", "WARNING") + log("获取失败,换个时间再来吧", "ERROR") else: log("获取成功!", "SUCCESS") clean_content() diff --git a/requirements.txt b/requirements.txt index 7f73074..daa3d86 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,4 @@ pandas==2.2.3 Requests==2.31.0 openpyxl==3.1.5 dateparser==1.2.0 -fake-useragent==1.5.1 pyinstaller==6.11.0