renyupeng 2 роки тому
батько
коміт
16903f2325

+ 79 - 77
spider/PromoterFansInfo.py

@@ -33,84 +33,86 @@ class PromoterFansInfo:
                 rep = requests.get(url=url, headers=headers)
                 rep = requests.get(url=url, headers=headers)
                 table_name = 'kwai_promoter_fans_info'
                 table_name = 'kwai_promoter_fans_info'
                 data = json.loads(rep.text)["data"]
                 data = json.loads(rep.text)["data"]
+                if data["fansProvinceFeature"] is None:
+                    SendFeiShuMsg.send_robot_msg("达人粉丝数据 is None")
+                else:
+                    promoter_fans_item = {"fansAgeFeature": json.dumps(data["fansAgeFeature"]),
+                                          "fansCityFeature": json.dumps(data["fansCityFeature"]),
+                                          "fansCityLevelFeature": json.dumps(data["fansCityLevelFeature"]),
+                                          "fansEquipBrandFeature": json.dumps(data["fansEquipBrandFeature"]),
+                                          "fansEquipPriceFeature": json.dumps(data["fansEquipPriceFeature"]),
+                                          "fansGenderFeature": json.dumps(data["fansGenderFeature"]),
+                                          "fansNumTrend": json.dumps(data["fansNumTrend"]),
+                                          "fansProvinceFeature": json.dumps(data["fansProvinceFeature"]),
+                                          "promoteAvgPrice": json.dumps(data["promoteAvgPrice"]),
+                                          "promoterId": promoterId,
+                                          "timeRangeType": i}
+                    insert(table_name=table_name, item=promoter_fans_item)
 
 
-                promoter_fans_item = {"fansAgeFeature": json.dumps(data["fansAgeFeature"]),
-                                      "fansCityFeature": json.dumps(data["fansCityFeature"]),
-                                      "fansCityLevelFeature": json.dumps(data["fansCityLevelFeature"]),
-                                      "fansEquipBrandFeature": json.dumps(data["fansEquipBrandFeature"]),
-                                      "fansEquipPriceFeature": json.dumps(data["fansEquipPriceFeature"]),
-                                      "fansGenderFeature": json.dumps(data["fansGenderFeature"]),
-                                      "fansNumTrend": json.dumps(data["fansNumTrend"]),
-                                      "fansProvinceFeature": json.dumps(data["fansProvinceFeature"]),
-                                      "promoteAvgPrice": json.dumps(data["promoteAvgPrice"]),
-                                      "promoterId": promoterId,
-                                      "timeRangeType": i}
-                insert(table_name=table_name, item=promoter_fans_item)
-
-                fans_type_date_list = []
-                fans_base_table = 'kwai_promoter_fans_base_info'
-
-                fansProvinceFeatureList = tuple(data["fansProvinceFeature"])
-                for fansProvinceFeature in fansProvinceFeatureList:
-                    fansProvinceFeatureItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'Province',
-                                               "type_date": fansProvinceFeature["provinceFeature"],
-                                               "FeatureRate": fansProvinceFeature["provinceFeatureRate"]}
-                    fans_type_date_list.append(fansProvinceFeatureItem)
-                fansAgeFeatureList = tuple(data["fansAgeFeature"])
-                for fansAgeFeature in fansAgeFeatureList:
-                    fansAgeFeatureItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'Age',
-                                          "type_date": fansAgeFeature["ageFeature"],
-                                          "FeatureRate": fansAgeFeature["ageFeatureRate"]}
-                    fans_type_date_list.append(fansAgeFeatureItem)
-
-                fansCityFeatureList = tuple(data["fansCityFeature"])
-                for fansCityFeature in fansCityFeatureList:
-                    fansCityFeatureItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'City',
-                                           "type_date": fansCityFeature["cityFeature"],
-                                           "FeatureRate": fansCityFeature["cityFeatureRate"]}
-                    fans_type_date_list.append(fansCityFeatureItem)
-                fansCityLevelFeatureList = tuple(data["fansCityLevelFeature"])
-                for fansCityLevelFeature in fansCityLevelFeatureList:
-                    fansCityLevelFeatureItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'CityLevel',
-                                                "type_date": fansCityLevelFeature["cityLevelFeature"],
-                                                "FeatureRate": fansCityLevelFeature["cityLevelRate"]}
-                    fans_type_date_list.append(fansCityLevelFeatureItem)
-                fansEquipBrandFeatureList = tuple(data["fansEquipBrandFeature"])
-                for fansEquipBrandFeature in fansEquipBrandFeatureList:
-                    fansEquipBrandFeatureItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'EquipBrand',
-                                                 "type_date": fansEquipBrandFeature["equipBrandTitleFeature"],
-                                                 "FeatureRate": fansEquipBrandFeature["equipBrandFeatureRate"]}
-                    fans_type_date_list.append(fansEquipBrandFeatureItem)
-                fansEquipPriceFeatureList = tuple(data["fansEquipPriceFeature"])
-                for fansEquipPriceFeature in fansEquipPriceFeatureList:
-                    fansEquipPriceFeatureItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'EquipPrice',
-                                                 "type_date": fansEquipPriceFeature["equipPriceFeature"],
-                                                 "FeatureRate": fansEquipPriceFeature["equipPriceFeatureRate"]}
-                    fans_type_date_list.append(fansEquipPriceFeatureItem)
-                promoteAvgPriceList = tuple(data["promoteAvgPrice"])
-                for promoteAvgPrice in promoteAvgPriceList:
-                    promoteAvgPriceItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'promoteAvgPrice',
-                                           "type_date": promoteAvgPrice["avgPriceFeature"],
-                                           "FeatureRate": promoteAvgPrice["avgPriceFeatureRate"]}
-                    fans_type_date_list.append(promoteAvgPriceItem)
-                fansGenderFeatureList = tuple(data["fansGenderFeature"])
-                for fansGenderFeature in fansGenderFeatureList:
-                    fansGenderFeatureItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'Gender',
-                                             "type_date": fansGenderFeature["genderFeature"],
-                                             "FeatureRate": fansGenderFeature["genderFeatureRate"]}
-                    fans_type_date_list.append(fansGenderFeatureItem)
-                batch_insert(table_name=fans_base_table, item_list=fans_type_date_list)
-                fans_trend_list = []
-                if i == 3:
-                    fans_trend_table = 'kwai_promoter_fans_trend_info'
-                    fansNumTrendList = tuple(data["fansNumTrend"])
-                    for fansNumTrend in fansNumTrendList:
-                        fansNumTrendItem = {"promoterId": promoterId,
-                                            "date": fansNumTrend["date"],
-                                            "fansTotalAmount": fansNumTrend["fansTotalAmount"],
-                                            "fansIncreaseAmount": fansNumTrend["fansIncreaseAmount"]}
-                        fans_trend_list.append(fansNumTrendItem)
-                    batch_insert(table_name=fans_trend_table, item_list=fans_trend_list)
+                    fans_type_date_list = []
+                    fans_base_table = 'kwai_promoter_fans_base_info'
+                    fansProvinceFeatureList = tuple(data["fansProvinceFeature"])
+                    for fansProvinceFeature in fansProvinceFeatureList:
+                        fansProvinceFeatureItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'Province',
+                                                   "type_date": fansProvinceFeature["provinceFeature"],
+                                                   "FeatureRate": fansProvinceFeature["provinceFeatureRate"]}
+                        fans_type_date_list.append(fansProvinceFeatureItem)
+                    fansAgeFeatureList = tuple(data["fansAgeFeature"])
+                    for fansAgeFeature in fansAgeFeatureList:
+                        fansAgeFeatureItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'Age',
+                                              "type_date": fansAgeFeature["ageFeature"],
+                                              "FeatureRate": fansAgeFeature["ageFeatureRate"]}
+                        fans_type_date_list.append(fansAgeFeatureItem)
+                    fansCityFeatureList = tuple(data["fansCityFeature"])
+                    for fansCityFeature in fansCityFeatureList:
+                        fansCityFeatureItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'City',
+                                               "type_date": fansCityFeature["cityFeature"],
+                                               "FeatureRate": fansCityFeature["cityFeatureRate"]}
+                        fans_type_date_list.append(fansCityFeatureItem)
+                    fansCityLevelFeatureList = tuple(data["fansCityLevelFeature"])
+                    for fansCityLevelFeature in fansCityLevelFeatureList:
+                        fansCityLevelFeatureItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'CityLevel',
+                                                    "type_date": fansCityLevelFeature["cityLevelFeature"],
+                                                    "FeatureRate": fansCityLevelFeature["cityLevelRate"]}
+                        fans_type_date_list.append(fansCityLevelFeatureItem)
+                    fansEquipBrandFeatureList = tuple(data["fansEquipBrandFeature"])
+                    for fansEquipBrandFeature in fansEquipBrandFeatureList:
+                        fansEquipBrandFeatureItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'EquipBrand',
+                                                     "type_date": fansEquipBrandFeature["equipBrandTitleFeature"],
+                                                     "FeatureRate": fansEquipBrandFeature["equipBrandFeatureRate"]}
+                        fans_type_date_list.append(fansEquipBrandFeatureItem)
+                    fansEquipPriceFeatureList = tuple(data["fansEquipPriceFeature"])
+                    for fansEquipPriceFeature in fansEquipPriceFeatureList:
+                        fansEquipPriceFeatureItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'EquipPrice',
+                                                     "type_date": fansEquipPriceFeature["equipPriceFeature"],
+                                                     "FeatureRate": fansEquipPriceFeature["equipPriceFeatureRate"]}
+                        fans_type_date_list.append(fansEquipPriceFeatureItem)
+                    promoteAvgPriceList = tuple(data["promoteAvgPrice"])
+                    for promoteAvgPrice in promoteAvgPriceList:
+                        promoteAvgPriceItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'promoteAvgPrice',
+                                               "type_date": promoteAvgPrice["avgPriceFeature"],
+                                               "FeatureRate": promoteAvgPrice["avgPriceFeatureRate"]}
+                        fans_type_date_list.append(promoteAvgPriceItem)
+                    fansGenderFeatureList = tuple(data["fansGenderFeature"])
+                    for fansGenderFeature in fansGenderFeatureList:
+                        fansGenderFeatureItem = {"promoterId": promoterId, "timeRangeType": i, "type": 'Gender',
+                                                 "type_date": fansGenderFeature["genderFeature"],
+                                                 "FeatureRate": fansGenderFeature["genderFeatureRate"]}
+                        fans_type_date_list.append(fansGenderFeatureItem)
+                    batch_insert(table_name=fans_base_table, item_list=fans_type_date_list)
+                    fans_trend_list = []
+                    if i == 3:
+                        fans_trend_table = 'kwai_promoter_fans_trend_info'
+                        fansNumTrendList = tuple(data["fansNumTrend"])
+                        for fansNumTrend in fansNumTrendList:
+                            fansNumTrendItem = {"promoterId": promoterId,
+                                                "date": fansNumTrend["date"],
+                                                "fansTotalAmount": fansNumTrend["fansTotalAmount"],
+                                                "fansIncreaseAmount": fansNumTrend["fansIncreaseAmount"]}
+                            fans_trend_list.append(fansNumTrendItem)
+                        batch_insert(table_name=fans_trend_table, item_list=fans_trend_list)
 
 
         except Exception as e:
         except Exception as e:
             SendFeiShuMsg.send_robot_msg('PromoterFansInfo请求错误请检查cookie{e}'.format(e=e))
             SendFeiShuMsg.send_robot_msg('PromoterFansInfo请求错误请检查cookie{e}'.format(e=e))
+
+

+ 67 - 64
spider/PromoterLiveInfoSpider.py

@@ -33,72 +33,75 @@ class PromoterLiveInfoSpider:
                                                                                             promoterId=promoterId)
                                                                                             promoterId=promoterId)
 
 
                 rep = requests.get(url=url, headers=headers)
                 rep = requests.get(url=url, headers=headers)
-
                 table_name = 'kwai_promoter_live_info'
                 table_name = 'kwai_promoter_live_info'
                 data = json.loads(rep.text)["data"]
                 data = json.loads(rep.text)["data"]
-                promoter_info_item = {"commentsCountInfo": json.dumps(data["commentsCountInfo"]),
-                                      "likesCountInfo": json.dumps(data["likesCountInfo"]),
-                                      "liveMinuteDurationInfo": json.dumps(data["liveMinuteDurationInfo"]),
-                                      "liveVisitorCountInfo": json.dumps(data["liveVisitorCountInfo"]),
-                                      "maxVisitorCountInfo": json.dumps(data["maxVisitorCountInfo"]),
-                                      "sharesCountInfo": json.dumps(data["sharesCountInfo"]),
-                                      "promoterId": data["promoterId"],
-                                      "staticDataInfoView": json.dumps(data["staticDataInfoView"]),
-                                      "timeRangeType": i}
-                insert(table_name=table_name, item=promoter_info_item)
-                base_table_name = 'kwai_promoter_live_base_info'
-                promoter_base_info_item = {
-                    "promoterId": data["promoterId"],
-                    "timeRangeType": i,
-                    "avgLiveStreamDuration": data["staticDataInfoView"]["avgLiveStreamDuration"],
-                    "avgLiveVisitorCount": data["staticDataInfoView"]["avgLiveVisitorCount"],
-                    "avgMinuteDuration": data["staticDataInfoView"]["avgMinuteDuration"],
-                    "avgPromoteSaleVolume": data["staticDataInfoView"]["avgPromoteSaleVolume"],
-                    "avgSameTimeVisitorCount": data["staticDataInfoView"]["avgSameTimeVisitorCount"],
-                    "avgViewTime": data["staticDataInfoView"]["avgViewTime"],
-                    "avgVisitorOnlineCount": data["staticDataInfoView"]["avgVisitorOnlineCount"],
-                    "interactionRate": data["staticDataInfoView"]["interactionRate"],
-                    "liveStreamVisitorCount": data["staticDataInfoView"]["liveStreamVisitorCount"],
-                    "maxLiveVisitorCount": data["staticDataInfoView"]["maxLiveVisitorCount"],
-                    "maxMinuteDuration": data["staticDataInfoView"]["maxMinuteDuration"],
-                    "maxPromoteSaleVolume": data["staticDataInfoView"]["maxPromoteSaleVolume"],
-                    "maxSameTimeVisitorCount": data["staticDataInfoView"]["maxSameTimeVisitorCount"],
-                    "minLiveVisitorCount": data["staticDataInfoView"]["minLiveVisitorCount"],
-                    "minMinuteDuration": data["staticDataInfoView"]["minMinuteDuration"],
-                    "minPromoteSaleVolume": data["staticDataInfoView"]["minPromoteSaleVolume"],
-                    "promoteItemCount": data["staticDataInfoView"]["promoteItemCount"],
-                    "promoteLiveCount": data["staticDataInfoView"]["promoteLiveCount"],
-                    "promoteLiveDays": data["staticDataInfoView"]["promoteLiveDays"],
-                    "promoteSaleVolume": data["staticDataInfoView"]["promoteSaleVolume"],
-                }
-                insert(table_name=base_table_name, item=promoter_base_info_item)
+                if data["likesCountInfo"] is None:
+                    SendFeiShuMsg.send_robot_msg("达人直播数据 is None")
+                else:
+                    promoter_info_item = {"commentsCountInfo": json.dumps(data["commentsCountInfo"]),
+                                          "likesCountInfo": json.dumps(data["likesCountInfo"]),
+                                          "liveMinuteDurationInfo": json.dumps(data["liveMinuteDurationInfo"]),
+                                          "liveVisitorCountInfo": json.dumps(data["liveVisitorCountInfo"]),
+                                          "maxVisitorCountInfo": json.dumps(data["maxVisitorCountInfo"]),
+                                          "sharesCountInfo": json.dumps(data["sharesCountInfo"]),
+                                          "promoterId": data["promoterId"],
+                                          "staticDataInfoView": json.dumps(data["staticDataInfoView"]),
+                                          "timeRangeType": i}
+                    insert(table_name=table_name, item=promoter_info_item)
+                    base_table_name = 'kwai_promoter_live_base_info'
+                    promoter_base_info_item = {
+                        "promoterId": data["promoterId"],
+                        "timeRangeType": i,
+                        "avgLiveStreamDuration": data["staticDataInfoView"]["avgLiveStreamDuration"],
+                        "avgLiveVisitorCount": data["staticDataInfoView"]["avgLiveVisitorCount"],
+                        "avgMinuteDuration": data["staticDataInfoView"]["avgMinuteDuration"],
+                        "avgPromoteSaleVolume": data["staticDataInfoView"]["avgPromoteSaleVolume"],
+                        "avgSameTimeVisitorCount": data["staticDataInfoView"]["avgSameTimeVisitorCount"],
+                        "avgViewTime": data["staticDataInfoView"]["avgViewTime"],
+                        "avgVisitorOnlineCount": data["staticDataInfoView"]["avgVisitorOnlineCount"],
+                        "interactionRate": data["staticDataInfoView"]["interactionRate"],
+                        "liveStreamVisitorCount": data["staticDataInfoView"]["liveStreamVisitorCount"],
+                        "maxLiveVisitorCount": data["staticDataInfoView"]["maxLiveVisitorCount"],
+                        "maxMinuteDuration": data["staticDataInfoView"]["maxMinuteDuration"],
+                        "maxPromoteSaleVolume": data["staticDataInfoView"]["maxPromoteSaleVolume"],
+                        "maxSameTimeVisitorCount": data["staticDataInfoView"]["maxSameTimeVisitorCount"],
+                        "minLiveVisitorCount": data["staticDataInfoView"]["minLiveVisitorCount"],
+                        "minMinuteDuration": data["staticDataInfoView"]["minMinuteDuration"],
+                        "minPromoteSaleVolume": data["staticDataInfoView"]["minPromoteSaleVolume"],
+                        "promoteItemCount": data["staticDataInfoView"]["promoteItemCount"],
+                        "promoteLiveCount": data["staticDataInfoView"]["promoteLiveCount"],
+                        "promoteLiveDays": data["staticDataInfoView"]["promoteLiveDays"],
+                        "promoteSaleVolume": data["staticDataInfoView"]["promoteSaleVolume"],
+                    }
+                    insert(table_name=base_table_name, item=promoter_base_info_item)
 
 
-                if i == 3:
-                    live_analyse_table_name = 'kwai_promoter_live_analyse_info'
-                    commentsCountInfo = tuple(data["commentsCountInfo"])
-                    likesCountInfo = tuple(data["likesCountInfo"])
-                    liveMinuteDurationInfo = tuple(data["liveMinuteDurationInfo"])
-                    liveVisitorCountInfo = tuple(data["liveVisitorCountInfo"])
-                    maxVisitorCountInfo = tuple(data["maxVisitorCountInfo"])
-                    sharesCountInfo = tuple(data["sharesCountInfo"])
-                    live_analyse_item_list = []
-                    for i in range(len(commentsCountInfo)):
-                        live_analyse_item = {}
-                        commentsCount = commentsCountInfo[i]
-                        likesCount = likesCountInfo[i]
-                        liveMinuteDuration = liveMinuteDurationInfo[i]
-                        liveVisitorCount = liveVisitorCountInfo[i]
-                        maxVisitorCount = maxVisitorCountInfo[i]
-                        sharesCount = sharesCountInfo[i]
-                        live_analyse_item["date"] = commentsCount["date"]
-                        live_analyse_item["promoterId"] = commentsCount["promoterId"]
-                        live_analyse_item["commentsCount"] = commentsCount["commentsCount"]
-                        live_analyse_item["likesCount"] = likesCount["likesCount"]
-                        live_analyse_item["liveMinuteDuration"] = liveMinuteDuration["minuteDuration"]
-                        live_analyse_item["liveVisitorCount"] = liveVisitorCount["visitorCount"]
-                        live_analyse_item["maxVisitorCount"] = maxVisitorCount["maxVisitorCount"]
-                        live_analyse_item["sharesCount"] = sharesCount["sharesCount"]
-                        live_analyse_item_list.append(live_analyse_item)
-                    batch_insert(table_name=live_analyse_table_name, item_list=live_analyse_item_list)
+                    if i == 3:
+                        live_analyse_table_name = 'kwai_promoter_live_analyse_info'
+                        commentsCountInfo = tuple(data["commentsCountInfo"])
+                        likesCountInfo = tuple(data["likesCountInfo"])
+                        liveMinuteDurationInfo = tuple(data["liveMinuteDurationInfo"])
+                        liveVisitorCountInfo = tuple(data["liveVisitorCountInfo"])
+                        maxVisitorCountInfo = tuple(data["maxVisitorCountInfo"])
+                        sharesCountInfo = tuple(data["sharesCountInfo"])
+                        live_analyse_item_list = []
+                        for i in range(len(commentsCountInfo)):
+                            live_analyse_item = {}
+                            commentsCount = commentsCountInfo[i]
+                            likesCount = likesCountInfo[i]
+                            liveMinuteDuration = liveMinuteDurationInfo[i]
+                            liveVisitorCount = liveVisitorCountInfo[i]
+                            maxVisitorCount = maxVisitorCountInfo[i]
+                            sharesCount = sharesCountInfo[i]
+                            live_analyse_item["date"] = commentsCount["date"]
+                            live_analyse_item["promoterId"] = commentsCount["promoterId"]
+                            live_analyse_item["commentsCount"] = commentsCount["commentsCount"]
+                            live_analyse_item["likesCount"] = likesCount["likesCount"]
+                            live_analyse_item["liveMinuteDuration"] = liveMinuteDuration["minuteDuration"]
+                            live_analyse_item["liveVisitorCount"] = liveVisitorCount["visitorCount"]
+                            live_analyse_item["maxVisitorCount"] = maxVisitorCount["maxVisitorCount"]
+                            live_analyse_item["sharesCount"] = sharesCount["sharesCount"]
+                            live_analyse_item_list.append(live_analyse_item)
+                        batch_insert(table_name=live_analyse_table_name, item_list=live_analyse_item_list)
         except Exception as e:
         except Exception as e:
             SendFeiShuMsg.send_robot_msg('PromoterLiveInfoSpider请求错误请检查cookie{e}'.format(e=e))
             SendFeiShuMsg.send_robot_msg('PromoterLiveInfoSpider请求错误请检查cookie{e}'.format(e=e))
+

+ 12 - 8
spider/PromoterVideoAnalysisTrend.py

@@ -33,6 +33,7 @@ class PromoterVideoAnalysisTrend:
                     .format(timeRangeType=i, promoterId=promoterId)
                     .format(timeRangeType=i, promoterId=promoterId)
                 rep = requests.get(url=url, headers=headers)
                 rep = requests.get(url=url, headers=headers)
                 table_name = 'kwai_promoter_video_analyse_info'
                 table_name = 'kwai_promoter_video_analyse_info'
+                print(json.loads(rep.text))
                 data = json.loads(rep.text)["data"]
                 data = json.loads(rep.text)["data"]
                 promoter_video_analyse_item = {"avgCommentCount": data["avgCommentCount"],
                 promoter_video_analyse_item = {"avgCommentCount": data["avgCommentCount"],
                                                "avgLikeCount": data["avgLikeCount"],
                                                "avgLikeCount": data["avgLikeCount"],
@@ -55,14 +56,17 @@ class PromoterVideoAnalysisTrend:
                     trend_name = 'kwai_promoter_video_report_analyse_info'
                     trend_name = 'kwai_promoter_video_report_analyse_info'
                     trends_list = tuple(data["trend"])
                     trends_list = tuple(data["trend"])
                     trend_list = []
                     trend_list = []
-
-                    for num in range(len(trends_list)):
-                        trend = trends_list[num]
-                        analyse_trend = {"date": trend["date"], "promoterId": promoterId,
-                                         "commentCount": trend["commentCount"], "likeCount": trend["likeCount"],
-                                         "shareCount": trend["shareCount"], "videoWatchCount": trend["videoWatchCount"]}
-                        trend_list.append(analyse_trend)
-                    batch_insert(table_name=trend_name, item_list=trend_list)
+                    if len(trends_list) == 0:
+                        SendFeiShuMsg.send_robot_msg("达人视频数为零")
+                    else:
+                        for num in range(len(trends_list)):
+                            trend = trends_list[num]
+                            analyse_trend = {"date": trend["date"], "promoterId": promoterId,
+                                             "commentCount": trend["commentCount"], "likeCount": trend["likeCount"],
+                                             "shareCount": trend["shareCount"],
+                                             "videoWatchCount": trend["videoWatchCount"]}
+                            trend_list.append(analyse_trend)
+                        batch_insert(table_name=trend_name, item_list=trend_list)
 
 
         except Exception as e:
         except Exception as e:
             SendFeiShuMsg.send_robot_msg('PromoterVideoAnalysisTrend请求错误请检查cookie{e}'.format(e=e))
             SendFeiShuMsg.send_robot_msg('PromoterVideoAnalysisTrend请求错误请检查cookie{e}'.format(e=e))