zhangyong 8 months ago
parent
commit
24fa90fccb
2 changed files with 25 additions and 26 deletions
  1. 1 1
      common/sql_help.py
  2. 24 25
      xssy_channel/sph_nrxs.py

+ 1 - 1
common/sql_help.py

@@ -280,7 +280,7 @@ class sqlCollect():
     """查询该账号是否存在"""
     @classmethod
     def select_crawler_uesr_v3(cls, link: str):
-        sql = """SELECT link FROM crawler_user_v3 WHERE link = %s  and source = 'jiqizidonggaizao'"""
+        sql = """SELECT uid FROM crawler_user_v3 WHERE link = %s  and source = 'jiqizidonggaizao'"""
         data = MysqlHelper.get_values(sql, (link))
         if data:
             return data

+ 24 - 25
xssy_channel/sph_nrxs.py

@@ -251,10 +251,11 @@ class SphNrxs:
                     for data in data_list:
                         nick_name = data['nickName']  # 用户名
                         user_name = data['username']  # 用户v2
-                        status = sqlCollect.select_crawler_uesr_v3(nick_name)
+                        status = sqlCollect.select_crawler_uesr_v3(uid)
                         if status:
-                            sqlCollect.insert_xssy_sph_info(uid, nick_name, user_name, "4")
-                            continue
+                            pq_id = status[0]
+                        else:
+                            pq_id = cls.insert_number(nick_name)
                         user = cls.get_sph_data(user_name, uid)
                         if user:
                             time.sleep(180)
@@ -264,29 +265,27 @@ class SphNrxs:
                                 has_used = cls.get_hx(appid)
                                 if has_used:
                                     if has_used == '0':
-                                        pq_id = cls.insert_number(nick_name)
-                                        if pq_id:
-                                            sqlCollect.insert_xssy_sph_info(uid, nick_name, user_name, has_used, appid, pq_id)
-                                            values = [
-                                                [
-                                                    "视频号",
-                                                    nick_name,
-                                                    pq_id,
-                                                    "5",
-                                                    "通用-分享到群",
-                                                    "AI片尾引导",
-                                                    "",
-                                                    "",
-                                                    "AI标题",
-                                                    "",
-                                                    f"溯源账号:{uid}"
-                                                ]
+                                        sqlCollect.insert_xssy_sph_info(uid, nick_name, user_name, has_used, appid, pq_id)
+                                        values = [
+                                            [
+                                                "视频号",
+                                                nick_name,
+                                                pq_id,
+                                                "5",
+                                                "通用-分享到群",
+                                                "AI片尾引导",
+                                                "",
+                                                "",
+                                                "AI标题",
+                                                "",
+                                                f"溯源账号:{uid}"
                                             ]
-                                            Feishu.insert_columns("WGIYsSDdxhItBwtJ0xgc0yE7nEg", '0701bd', "ROWS", 1, 2)
-                                            time.sleep(0.5)
-                                            Feishu.update_values("WGIYsSDdxhItBwtJ0xgc0yE7nEg", '0701bd', "B2:Z2",
-                                                                 values)
-                                            Feishu.bot("xinxin", '视频号溯源成功提示', f'原账号:{uid},溯源到的账号:{nick_name},写入账号:{pq_id}', 'xinxin')
+                                        ]
+                                        Feishu.insert_columns("WGIYsSDdxhItBwtJ0xgc0yE7nEg", '0701bd', "ROWS", 1, 2)
+                                        time.sleep(0.5)
+                                        Feishu.update_values("WGIYsSDdxhItBwtJ0xgc0yE7nEg", '0701bd', "B2:Z2",
+                                                             values)
+                                        Feishu.bot("xinxin", '视频号溯源成功提示', f'原账号:{uid},溯源到的账号:{nick_name},写入账号:{pq_id}', 'xinxin')
                                     else:
                                         sqlCollect.insert_xssy_sph_info(uid, nick_name, user_name, has_used, appid)
                         else: