From f1ee7d6736a98c3b8cf71a84498575cc76475e8c Mon Sep 17 00:00:00 2001 From: LibraHp_0928 <1941163264@qq.com> Date: Thu, 14 Nov 2024 15:22:21 +0800 Subject: [PATCH 1/3] update --- .github/workflows/build-and-release.yml | 2 +- main.py | 7 +++---- requirements.txt | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) 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 From dd1633ea11dd8ee172be0b2d2397d29f425a3097 Mon Sep 17 00:00:00 2001 From: LibraHp_0928 <1941163264@qq.com> Date: Thu, 14 Nov 2024 15:26:22 +0800 Subject: [PATCH 2/3] Revert "update" This reverts commit f1ee7d6736a98c3b8cf71a84498575cc76475e8c. --- .github/workflows/build-and-release.yml | 2 +- main.py | 7 ++++--- requirements.txt | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 282bee4..e800aa1 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 54bdc9c..6b4f98c 100644 --- a/main.py +++ b/main.py @@ -17,7 +17,9 @@ import traceback import dateparser import hashlib import copy +from fake_useragent import UserAgent +ua = UserAgent() # 程序版本 version = "1.0.2" @@ -66,7 +68,7 @@ headers = { 'sec-fetch-user': '?1', 'upgrade-insecure-requests': '1', # Temporarily fix waf issues - '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', + 'user-agent': ua.random, } @@ -1049,7 +1051,6 @@ def main(page: ft.Page): ) def get_message(start, count): - global is_stop for i in range(5): if i == 4: log("请求频繁,换个时间再试吧", "ERROR") @@ -1235,7 +1236,7 @@ def main(page: ft.Page): # 完成消息获取 content_area.content.clean() if is_stop: - log("获取失败,换个时间再来吧", "ERROR") + log("获取失败,换个时间再来吧", "WARNING") else: log("获取成功!", "SUCCESS") clean_content() diff --git a/requirements.txt b/requirements.txt index daa3d86..7f73074 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,5 @@ 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 From c10b6f07dbe9bf8480154b1aaafb866416458d9d Mon Sep 17 00:00:00 2001 From: LibraHp_0928 <1941163264@qq.com> Date: Thu, 14 Nov 2024 15:27:50 +0800 Subject: [PATCH 3/3] update --- .github/workflows/build-and-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index e800aa1..a976aaf 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -43,7 +43,7 @@ jobs: - name: Flet Build macOS (aarch64) 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 (aarch64) build run: | @@ -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: |