|
@@ -90,24 +90,24 @@ class ZZHXZFYRecommend(object):
|
|
|
处理视频
|
|
|
:param video_obj:
|
|
|
"""
|
|
|
- video_url = self.get_video_url(video_obj["vid"])
|
|
|
+ video_url, cover_url = self.get_video_url(video_obj["vid"])
|
|
|
if not video_url:
|
|
|
return
|
|
|
time.sleep(random.randint(3, 8))
|
|
|
trace_id = self.platform + str(uuid.uuid1())
|
|
|
our_user = random.choice(self.user_list)
|
|
|
item = VideoItem()
|
|
|
- item.add_video_info("video_id", video_obj["id"])
|
|
|
+ item.add_video_info("video_id", video_obj["vid"])
|
|
|
item.add_video_info("video_title", video_obj["vtitle"])
|
|
|
item.add_video_info("play_cnt", 0)
|
|
|
item.add_video_info("publish_time_stamp", int(time.time()))
|
|
|
- item.add_video_info("out_user_id", video_obj["id"])
|
|
|
- # item.add_video_info("cover_url", video_obj["cover"])
|
|
|
+ item.add_video_info("out_user_id", video_obj["vid"])
|
|
|
+ item.add_video_info("cover_url", cover_url)
|
|
|
item.add_video_info("like_cnt", 0)
|
|
|
item.add_video_info("share_cnt", 0)
|
|
|
item.add_video_info("comment_cnt", 0)
|
|
|
item.add_video_info("video_url", video_url)
|
|
|
- item.add_video_info("out_video_id", video_obj["id"])
|
|
|
+ item.add_video_info("out_video_id", video_obj["vid"])
|
|
|
item.add_video_info("platform", self.platform)
|
|
|
item.add_video_info("strategy", self.mode)
|
|
|
item.add_video_info("session", "{}-{}".format(self.platform, int(time.time())))
|
|
@@ -173,7 +173,8 @@ class ZZHXZFYRecommend(object):
|
|
|
),
|
|
|
return None
|
|
|
video_url = response['data']['data']['content_link']
|
|
|
- return video_url
|
|
|
+ cover_url = response['data']['data']['image_url_list'][0]['image_url']
|
|
|
+ return video_url, cover_url
|
|
|
except Exception as e:
|
|
|
return None
|
|
|
|