zhangyong 4 ماه پیش
والد
کامیت
d305355135
9فایلهای تغییر یافته به همراه57 افزوده شده و 32 حذف شده
  1. 9 0
      common/feishu_form.py
  2. 6 4
      job_keyword_dy.py
  3. 6 4
      job_keyword_ks.py
  4. 6 4
      job_keyword_sph.py
  5. 6 4
      job_ks_feed.py
  6. 6 4
      job_pl_dy.py
  7. 6 4
      job_pl_ks.py
  8. 6 4
      job_sph.py
  9. 6 4
      job_sph_feed.py

+ 9 - 0
common/feishu_form.py

@@ -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]
+
     """
     获取汇总表所有负责人列表
     """

+ 6 - 4
job_keyword_dy.py

@@ -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}")

+ 6 - 4
job_keyword_ks.py

@@ -11,10 +11,12 @@ def video_task_start():
         try:
             count = sqlCollect.get_channel_count("快手搜索", "品类关键词搜索")
             count = int(count[0][0])
-            if count >= 590:
-                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}")

+ 6 - 4
job_keyword_sph.py

@@ -11,10 +11,12 @@ def video_task_start():
         try:
             count = sqlCollect.get_channel_count("视频号搜索", "品类关键词搜索")
             count = int(count[0][0])
-            if count >= 100:
-                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}")

+ 6 - 4
job_ks_feed.py

@@ -9,10 +9,12 @@ def video_task_start():
         try:
             count = sqlCollect.get_feed_count("快手推荐流")
             count = int(count[0][0])
-            if count >= 130:
-                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}")

+ 6 - 4
job_pl_dy.py

@@ -11,10 +11,12 @@ def video_task_start():
         try:
             count =  sqlCollect.get_name_count("抖音品类账号")
             count = int(count[0][0])
-            if count >= 940:
-                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}")

+ 6 - 4
job_pl_ks.py

@@ -11,10 +11,12 @@ def video_task_start():
         try:
             count = sqlCollect.get_name_count("快手品类账号")
             count = int(count[0][0])
-            if count >= 1120:
-                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}")

+ 6 - 4
job_sph.py

@@ -11,10 +11,12 @@ def video_task_start():
         try:
             count = sqlCollect.get_name_count("视频号品类账号")
             count = int(count[0][0])
-            if count >= 80:
-                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}")

+ 6 - 4
job_sph_feed.py

@@ -11,10 +11,12 @@ def video_task_start():
         try:
             count = sqlCollect.get_feed_count("视频号推荐流")
             count = int(count[0][0])
-            if count >= 100:
-                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}")