|
@@ -100,8 +100,8 @@ class SearchKey:
|
|
return "未找到wechat_key"
|
|
return "未找到wechat_key"
|
|
else:
|
|
else:
|
|
for content in contents:
|
|
for content in contents:
|
|
- if content["host"] == "search.weixin.qq.com" and content[
|
|
|
|
- "path"] == "/cgi-bin/wxaweb/wxindexgetusergroup":
|
|
|
|
|
|
+ # if content["host"] == "search.weixin.qq.com" and content["path"] == "/cgi-bin/wxaweb/wxindexgetusergroup":
|
|
|
|
+ if content["host"] == "search.weixin.qq.com" and content["path"] == "/cgi-bin/wxaweb/wxawebreport":
|
|
# print(f"content:{content}")
|
|
# print(f"content:{content}")
|
|
text = content['request']['body']['text']
|
|
text = content['request']['body']['text']
|
|
search_key = json.loads(text)['search_key']
|
|
search_key = json.loads(text)['search_key']
|
|
@@ -130,7 +130,7 @@ class SearchKey:
|
|
def del_wechat_key(cls, log_type, crawler):
|
|
def del_wechat_key(cls, log_type, crawler):
|
|
try:
|
|
try:
|
|
while True:
|
|
while True:
|
|
- sheet = Feishu.get_values_batch(log_type, crawler, 'pIW4Bq')
|
|
|
|
|
|
+ sheet = Feishu.get_values_batch(log_type, crawler, 'sVL74k')
|
|
if sheet is None:
|
|
if sheet is None:
|
|
Common.logger(log_type, crawler).info(f"wechat_key_sheet:{sheet}, 1秒后重新获取")
|
|
Common.logger(log_type, crawler).info(f"wechat_key_sheet:{sheet}, 1秒后重新获取")
|
|
time.sleep(1)
|
|
time.sleep(1)
|
|
@@ -138,7 +138,7 @@ class SearchKey:
|
|
if len(sheet) <= 51:
|
|
if len(sheet) <= 51:
|
|
return
|
|
return
|
|
else:
|
|
else:
|
|
- Feishu.dimension_range(log_type, crawler, 'pIW4Bq', 'ROWS', 52, 52)
|
|
|
|
|
|
+ Feishu.dimension_range(log_type, crawler, 'sVL74k', 'ROWS', 52, 52)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
Common.logger(log_type, crawler).error(f"del_wechat_key异常:{e}\n")
|
|
Common.logger(log_type, crawler).error(f"del_wechat_key异常:{e}\n")
|
|
|
|
|
|
@@ -159,11 +159,11 @@ class SearchKey:
|
|
continue
|
|
continue
|
|
for k, v in wechat_key_dict.items():
|
|
for k, v in wechat_key_dict.items():
|
|
Common.logger(log_type, crawler).info(f"{k}:{v}")
|
|
Common.logger(log_type, crawler).info(f"{k}:{v}")
|
|
- Feishu.insert_columns(log_type, crawler, 'pIW4Bq', 'ROWS', 1, 2)
|
|
|
|
|
|
+ Feishu.insert_columns(log_type, crawler, 'sVL74k', 'ROWS', 1, 2)
|
|
time_str = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(int(time.time())))
|
|
time_str = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(int(time.time())))
|
|
values = [[time_str, wechat_key_dict['search_key'], wechat_key_dict['openid']]]
|
|
values = [[time_str, wechat_key_dict['search_key'], wechat_key_dict['openid']]]
|
|
time.sleep(1)
|
|
time.sleep(1)
|
|
- Feishu.update_values(log_type, crawler, 'pIW4Bq', 'A2:Z2', values)
|
|
|
|
|
|
+ Feishu.update_values(log_type, crawler, 'sVL74k', 'A2:Z2', values)
|
|
cls.del_wechat_key(log_type, crawler)
|
|
cls.del_wechat_key(log_type, crawler)
|
|
Common.logger(log_type, crawler).info("wechat_key写入飞书成功")
|
|
Common.logger(log_type, crawler).info("wechat_key写入飞书成功")
|
|
Common.del_logs(log_type, crawler)
|
|
Common.del_logs(log_type, crawler)
|