From 9681477ee864cd9d92099a9e95e2da7af8e6729e Mon Sep 17 00:00:00 2001 From: oscarz Date: Fri, 20 Jun 2025 09:01:59 +0800 Subject: [PATCH] modify scripts --- u9a9/src/fetch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/u9a9/src/fetch.py b/u9a9/src/fetch.py index 94a92cb..fc21901 100644 --- a/u9a9/src/fetch.py +++ b/u9a9/src/fetch.py @@ -47,9 +47,9 @@ def fetch_list(start_p=1): url = f"https://u001.25img.com/?p={p}" if p % 10 == 0 : lines = utils.append_to_csv(total_results, target_csv) - total_results.clear() # 清空缓冲区 if lines: logging.info(f"write to csv file. new lines: {len(total_results)}, total lines: {lines}") + total_results.clear() # 清空缓冲区 time.sleep(1) else: logging.warning(f"fetch_list failed. url: {url} ") @@ -140,9 +140,9 @@ def fetch_sis_list(url = 'https://sis001.com/forum/forum-25-1.html', target_csv_ cnt += 1 if cnt % 10 == 0 : lines = utils.append_to_csv(total_results, target_csv_sis) - total_results.clear() if lines: logging.info(f"write to csv file. new lines: {len(total_results)}, total lines: {lines}") + total_results.clear() time.sleep(1) else: logging.warning(f"fetch_list failed. url: {url} ")