|
@@ -434,38 +434,41 @@ def new_video_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type
|
|
|
flowFlag_dict = {}
|
|
|
for per_item in all_recall_result:
|
|
|
#print(per_item)
|
|
|
- vId = int(per_item.get("videoId",0))
|
|
|
- if vId==0:
|
|
|
- continue
|
|
|
- recall_name = per_item.get("pushFrom",'')
|
|
|
- flow_pool = per_item.get("flowPool", '')
|
|
|
- if flow_pool != '':
|
|
|
- flow_pool_id = int(flow_pool.split('#')[0])
|
|
|
- if flow_pool_id == config_.QUICK_FLOW_POOL_ID:
|
|
|
- fast_flow_set.add(vId)
|
|
|
+ try:
|
|
|
+ vId = int(per_item.get("videoId",0))
|
|
|
+ if vId==0:
|
|
|
+ continue
|
|
|
+ recall_name = per_item.get("pushFrom",'')
|
|
|
+ flow_pool = per_item.get("flowPool", '')
|
|
|
+ if flow_pool != '':
|
|
|
+ flow_pool_id = int(flow_pool.split('#')[0])
|
|
|
+ if flow_pool_id == config_.QUICK_FLOW_POOL_ID:
|
|
|
+ fast_flow_set.add(vId)
|
|
|
+ else:
|
|
|
+ flow_flow_set.add(vId)
|
|
|
+ flowFlag_dict[vId] = flow_pool
|
|
|
+
|
|
|
+ #duplicate divide into
|
|
|
+ if vId not in recall_dict:
|
|
|
+ if recall_name == config_.PUSH_FROM['rov_recall_region_h']:
|
|
|
+ region_h_recall.append(per_item)
|
|
|
+ elif recall_name == config_.PUSH_FROM['rov_recall_region_24h']:
|
|
|
+ region_day_recall.append(per_item)
|
|
|
+ elif recall_name == config_.PUSH_FROM['rov_recall_24h']:
|
|
|
+ select_day_recall.append(per_item)
|
|
|
+ elif recall_name == config_.PUSH_FROM['rov_recall_24h_dup']:
|
|
|
+ no_selected_recall.append(per_item)
|
|
|
+ elif recall_name == config_.PUSH_FROM['sim_hot_vid_recall']:
|
|
|
+ sim_hot_recall.append(per_item)
|
|
|
+ elif recall_name == config_.PUSH_FROM['flow_recall']:
|
|
|
+ flow_recall.append(per_item)
|
|
|
+ if vId not in recall_dict:
|
|
|
+ recall_dict[vId] = recall_name
|
|
|
else:
|
|
|
- flow_flow_set.add(vId)
|
|
|
- flowFlag_dict[vId] = flow_pool
|
|
|
-
|
|
|
- #duplicate divide into
|
|
|
- if vId not in recall_dict:
|
|
|
- if recall_name == config_.PUSH_FROM['rov_recall_region_h']:
|
|
|
- region_h_recall.append(per_item)
|
|
|
- elif recall_name == config_.PUSH_FROM['rov_recall_region_24h']:
|
|
|
- region_day_recall.append(per_item)
|
|
|
- elif recall_name == config_.PUSH_FROM['rov_recall_24h']:
|
|
|
- select_day_recall.append(per_item)
|
|
|
- elif recall_name == config_.PUSH_FROM['rov_recall_24h_dup']:
|
|
|
- no_selected_recall.append(per_item)
|
|
|
- elif recall_name == config_.PUSH_FROM['sim_hot_vid_recall']:
|
|
|
- sim_hot_recall.append(per_item)
|
|
|
- elif recall_name == config_.PUSH_FROM['flow_recall']:
|
|
|
- flow_recall.append(per_item)
|
|
|
- if vId not in recall_dict:
|
|
|
- recall_dict[vId] = recall_name
|
|
|
- else:
|
|
|
- recall_name = recall_dict[vId] + "," + recall_name
|
|
|
- recall_dict[vId] = recall_name
|
|
|
+ recall_name = recall_dict[vId] + "," + recall_name
|
|
|
+ recall_dict[vId] = recall_name
|
|
|
+ except:
|
|
|
+ continue
|
|
|
#print("recall_dict:", recall_dict)
|
|
|
#3. filter video, 先过预曝光
|
|
|
filter_ = FilterVideos(request_id=request_id,
|