浏览代码

2024-10-21 文章匹配小程序老服务

修改 1:
minigram.py 长文 daily, 投流的小程序修改为 4

修改 2
response.py
取消长文小程序随机打散的功能,长文小程序只返回 4 的信息
luojunhui 6 月之前
父节点
当前提交
8087211fde
共有 2 个文件被更改,包括 40 次插入49 次删除
  1. 15 21
      applications/deal/minigram.py
  2. 25 28
      applications/deal/response.py

+ 15 - 21
applications/deal/minigram.py

@@ -5,12 +5,6 @@ from applications.functions.forward import forward_requests
 
 minigram_map = {
     1: {
-        # 25: {
-        #     "avatar": "https://rescdn.yishihui.com/0temp/ttmhzfsh.png",
-        #     "id": "wx0b7d95eb293b783b",
-        #     "name": "天天美好祝福生活",
-        #     "index": 25
-        # },
         25: {
                 "avatar": "https://rescdn.yishihui.com/0temp/pqsp.png",
                 "id": "wxbdd2a2e93d9a6e25",
@@ -18,25 +12,25 @@ minigram_map = {
                 "index": 25
             },
         29: {
-            "avatar": "https://rescdn.yishihui.com/0temp/cyfyld.png",
-            "id": "wx65c76bb4c67934db",
-            "name": "财运福运来到",
-            "index": 29
-        },
+                "avatar": "https://rescdn.yishihui.com/0temp/pqsp.png",
+                "id": "wxbdd2a2e93d9a6e25",
+                "name": "票圈视频",
+                "index": 29
+            },
         31: {
-            "avatar": "https://rescdn.yishihui.com/0temp/mhzfshxf2.png",
-            "id": "wx2e4478b1641b3b15",
-            "name": "美好祝福生活幸福",
-            "index": 31
-        }
+                "avatar": "https://rescdn.yishihui.com/0temp/pqsp.png",
+                "id": "wxbdd2a2e93d9a6e25",
+                "name": "票圈视频",
+                "index": 31
+            }
     },
     2: {
         36: {
-            "avatar": "https://rescdn.yishihui.com/0temp/zfyfyc.jpeg",
-            "id": "wxcddf231abd0dabdc",
-            "name": "祝福有福有财",
-            "index": 36
-        },
+                "avatar": "https://rescdn.yishihui.com/0temp/pqsp.png",
+                "id": "wxbdd2a2e93d9a6e25",
+                "name": "票圈视频",
+                "index": 36
+            },
         33: {
             "avatar": "https://rescdn.yishihui.com/0temp/pqsp.png",
             "id": "wxbdd2a2e93d9a6e25",

+ 25 - 28
applications/deal/response.py

@@ -35,12 +35,6 @@ class Response(object):
         self.mini_program_type = mini_program_type
         self.strategy = strategy
         self.mini_map = {
-            # 25: {
-            #     "avatar": "https://rescdn.yishihui.com/0temp/ttmhzfsh.png",
-            #     "id": "wx0b7d95eb293b783b",
-            #     "name": "天天美好祝福生活",
-            #     "index": 25,
-            # },
             25: {
                 "avatar": "https://rescdn.yishihui.com/0temp/pqsp.png",
                 "id": "wxbdd2a2e93d9a6e25",
@@ -48,22 +42,22 @@ class Response(object):
                 "index": 25
             },
             29: {
-                "avatar": "https://rescdn.yishihui.com/0temp/cyfyld.png",
-                "id": "wx65c76bb4c67934db",
-                "name": "财运福运来到",
-                "index": 29,
+                "avatar": "https://rescdn.yishihui.com/0temp/pqsp.png",
+                "id": "wxbdd2a2e93d9a6e25",
+                "name": "票圈视频",
+                "index": 29
             },
             31: {
-                "avatar": "https://rescdn.yishihui.com/0temp/mhzfshxf2.png",
-                "id": "wx2e4478b1641b3b15",
-                "name": "美好祝福生活幸福",
-                "index": 31,
+                "avatar": "https://rescdn.yishihui.com/0temp/pqsp.png",
+                "id": "wxbdd2a2e93d9a6e25",
+                "name": "票圈视频",
+                "index": 31
             },
             36: {
-                "avatar": "https://rescdn.yishihui.com/0temp/zfyfyc.jpeg",
-                "id": "wxcddf231abd0dabdc",
-                "name": "祝福有福有财",
-                "index": 36,
+                "avatar": "https://rescdn.yishihui.com/0temp/pqsp.png",
+                "id": "wxbdd2a2e93d9a6e25",
+                "name": "票圈视频",
+                "index": 36
             },
             27: {
                 "avatar": "https://rescdn.yishihui.com/0temp/xymhfqdd.png",
@@ -240,25 +234,28 @@ class Response(object):
         :return:
         """
         L = []
+        LONG_ARTICLES_MINI_ID = 25
+        TOULIU_MINI_ID = 33
+        WECOME_MINI_ID = 27
         if self.mini_program_type == 1:
             # mini_id_list = [25, 29, 31]
             # video_count = len(video_list)
             # mini_choice_index = random.sample(range(3), video_count)
             # mini_choice_item = [mini_id_list[i] for i in mini_choice_index]
             for index, video_id in enumerate(video_list, 1):
-                random_num = random.randint(1, 10)
-                if random_num in [1, 2, 3, 4, 5, 6]:
-                    mini_id = 25
-                elif random_num in [7, 8]:
-                    mini_id = 29
-                else:
-                    mini_id = 31
+                # random_num = random.randint(1, 10)
+                # if random_num in [1, 2, 3, 4, 5, 6]:
+                #     mini_id = 25
+                # elif random_num in [7, 8]:
+                #     mini_id = 29
+                # else:
+                #     mini_id = 31
                 result = await self.generate_card(
                     video_id=video_id,
                     kimi_title=kimi_title,
                     index=index,
                     gh_id=gh_id,
-                    mini_id=mini_id,
+                    mini_id=LONG_ARTICLES_MINI_ID,
                 )
                 L.append(result)
         elif self.mini_program_type == 2:
@@ -268,7 +265,7 @@ class Response(object):
                     kimi_title=kimi_title,
                     index=index,
                     gh_id=gh_id,
-                    mini_id=33,
+                    mini_id=TOULIU_MINI_ID,
                 )
                 L.append(result)
         elif self.mini_program_type == 3:
@@ -278,7 +275,7 @@ class Response(object):
                     kimi_title=kimi_title,
                     index=index,
                     gh_id=gh_id,
-                    mini_id=27,
+                    mini_id=WECOME_MINI_ID,
                 )
                 L.append(result)
         return L