From 58aac99a1c25849687658ac5c8c54d2e13543c38 Mon Sep 17 00:00:00 2001 From: xiaofeng wang Date: Thu, 17 Jul 2025 16:44:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=BF=E6=8D=A2=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=B9=B6=E6=B7=BB=E5=8A=A0=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E4=BB=A5=E5=A2=9E=E5=BC=BA=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oneget.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/oneget.py b/oneget.py index 90ab7bf..355c825 100644 --- a/oneget.py +++ b/oneget.py @@ -7,7 +7,7 @@ import random import time import copy from threading import Lock -import logging +from logger import logger from DB import DBVidcon, DBSA import json from requests.adapters import HTTPAdapter @@ -15,7 +15,6 @@ from urllib3.util.retry import Retry from dateutil import parser as date_parser MACHINE_ID = 3 -logger = logging.getLogger(__name__) db = DBVidcon() proxiesdict = db.get_proxy_agent_dict() @@ -233,7 +232,7 @@ def main(): if not kwdata: logger.error("没有获取到关键词数据") exit(1) - + logger.info(f"搜索关键词数据: {kwdata}") kwdata = kwdata[0][1] rn = kwdata['rn'] proxy_name = proxiesdict.get(rn) @@ -623,6 +622,7 @@ def main(): data = response.json() edges = data['data']['search']['stories']['edges'] edges_len = len(edges) + logger.info(f"第 {i} 页,关键词: {kw},获取到 {edges_len} 条数据") tancks = [] for j, edge in enumerate(edges): node = edge.get("node", {}) @@ -637,7 +637,6 @@ def main(): "level": 0, } tancks.append(s_data) - # 我想在这加入20 个线程池 with concurrent.futures.ThreadPoolExecutor(max_workers=20) as executor: executor.map(dmvideo_info.get_video_info, tancks) if edges_len < 20: