Browse Source

新增代投字段

luojunhui 4 months ago
parent
commit
d876fbedef
1 changed files with 13 additions and 0 deletions
  1. 13 0
      applications/deal/response.py

+ 13 - 0
applications/deal/response.py

@@ -133,6 +133,8 @@ class Response(object):
             source_id = "longArticles_" + generate_source_id()
         elif self.mini_program_type == 3:
             source_id = "WeCom_" + generate_source_id()
+        elif self.mini_program_type == 4:
+            source_id = "DaiTou_{}_".format(gh_id) + generate_source_id()
         else:
             source_id = "Error mini_program_type {}".format(self.mini_program_type)
         url = f"pages/user-videos?id={video_id}&su={shared_uid}&fromGzh=1&rootShareId={root_share_id}&shareId={root_share_id}&rootSourceId={source_id}"
@@ -236,6 +238,7 @@ class Response(object):
         LONG_ARTICLES_MINI_ID = 25
         TOULIU_MINI_ID = 33
         WECOME_MINI_ID = 27
+        DAITOU_MINI_ID = 25
         if self.mini_program_type == 1:
             # mini_id_list = [25, 29, 31]
             # video_count = len(video_list)
@@ -277,6 +280,16 @@ class Response(object):
                     mini_id=WECOME_MINI_ID,
                 )
                 L.append(result)
+        elif self.mini_program_type == 4:
+            for index, video_id in enumerate(video_list, 1):
+                result = await self.generate_card(
+                    video_id=video_id,
+                    kimi_title=kimi_title,
+                    index=index,
+                    gh_id=gh_id,
+                    mini_id=DAITOU_MINI_ID,
+                )
+                L.append(result)
         return L
 
     async def deal(self):