@@ -13,6 +13,15 @@ from common.feishu_utils import Feishu
class Material():
+
+ @classmethod
+ def get_count_restrict(cls, channel):
+ count_channel = Feishu.get_values_batch("WuoQsVFXChVMK4tDHqLcwLWgnjh", "qlb61Z")
+ for row in count_channel[1:]:
+ sheet_channel = row[0]
+ if sheet_channel == channel:
+ return row[1]
"""
获取汇总表所有负责人列表
@@ -11,10 +11,12 @@ def video_task_start():
try:
count = sqlCollect.get_channel_count("抖音搜索", "品类关键词搜索")
count = int(count[0][0])
- if count >= 1720:
- print(f"到了限制数{count}")
- time.sleep(3600)
- continue
+ sheet_count = Material.get_count_restrict("抖音关键词搜索")
+ if sheet_count:
+ if count >= int(sheet_count):
+ print(f"到了限制数{count}")
+ time.sleep(3600)
+ continue
print("开始执行任务")
mark = VideoProcessor.main(data)
print(f"返回用户名: {mark}")
count = sqlCollect.get_channel_count("快手搜索", "品类关键词搜索")
- if count >= 590:
+ sheet_count = Material.get_count_restrict("快手关键词搜索")
count = sqlCollect.get_channel_count("视频号搜索", "品类关键词搜索")
- if count >= 100:
+ sheet_count = Material.get_count_restrict("视频号关键词搜索")
@@ -9,10 +9,12 @@ def video_task_start():
count = sqlCollect.get_feed_count("快手推荐流")
- if count >= 130:
+ sheet_count = Material.get_count_restrict("快手推荐流")
count = sqlCollect.get_name_count("抖音品类账号")
- if count >= 940:
+ sheet_count = Material.get_count_restrict("抖音品类账号")
count = sqlCollect.get_name_count("快手品类账号")
- if count >= 1120:
+ sheet_count = Material.get_count_restrict("快手品类账号")
count = sqlCollect.get_name_count("视频号品类账号")
- if count >= 80:
+ sheet_count = Material.get_count_restrict("视频号品类账号")
count = sqlCollect.get_feed_count("视频号推荐流")
+ sheet_count = Material.get_count_restrict("视频号推荐流")