|
@@ -178,8 +178,8 @@ class GZH:
|
|
|
cls.begin += 5
|
|
|
if 'app_msg_list' not in r.json() or len(r.json()['app_msg_list']) == 0:
|
|
|
Common.logger(log_type).warning("get_gzh_url:response:{}\n", r.text)
|
|
|
- Common.logger(log_type).info('休眠 3 - 60 分钟')
|
|
|
- time.sleep(random.randint(60*3, 60*60))
|
|
|
+ Common.logger(log_type).info('休眠 60 秒')
|
|
|
+ time.sleep(60)
|
|
|
break
|
|
|
else:
|
|
|
app_msg_list = r.json()['app_msg_list']
|
|
@@ -236,9 +236,9 @@ class GZH:
|
|
|
# 判断无效文章
|
|
|
if gzh_url == 0:
|
|
|
Common.logger(log_type).info("无效文章\n")
|
|
|
- elif int(time.time()) - int(create_time) > 3600*24*10:
|
|
|
+ elif int(time.time()) - int(create_time) > 3600*24*3:
|
|
|
Common.logger(log_type).info(
|
|
|
- "发布时间{}超过 10 天\n", time.strftime("%Y/%m/%d %H:%M:%S", time.localtime(create_time)))
|
|
|
+ "发布时间{}超过 3 天\n", time.strftime("%Y/%m/%d %H:%M:%S", time.localtime(create_time)))
|
|
|
return
|
|
|
# 时长判断
|
|
|
elif int(duration) < 60:
|
|
@@ -275,7 +275,7 @@ class GZH:
|
|
|
Feishu.update_values(log_type, 'gzh', 'P6GKb3', 'F2:W2', values)
|
|
|
Common.logger(log_type).info("文章写入文档成功\n")
|
|
|
|
|
|
- if len(cls.gzh_count) >= 3:
|
|
|
+ if len(cls.gzh_count) >= 1:
|
|
|
Common.logger(log_type).info("当前用户已抓取:{}条数据\n", len(cls.gzh_count))
|
|
|
cls.gzh_count = []
|
|
|
return
|
|
@@ -297,7 +297,7 @@ class GZH:
|
|
|
cls.get_gzh_url(log_type, username, userid, head_url)
|
|
|
Common.logger(log_type).info("下载/上传 {} 公众号视频\n", username)
|
|
|
cls.run_download_publish(log_type, env)
|
|
|
- Common.logger(log_type).info("休眠 3 - 30 分钟")
|
|
|
+ Common.logger(log_type).info("休眠 3 - 15 分钟")
|
|
|
time.sleep(random.randint(60*3, 60*15))
|
|
|
except Exception as e:
|
|
|
Common.logger(log_type).error("get_all_gzh异常:{}\n", e)
|