|
@@ -12,7 +12,7 @@ class KsKeyword:
|
|
|
@classmethod
|
|
|
def get_key_word(cls, keyword, task_mark, mark, channel_id, name, task):
|
|
|
combo = task['combo']
|
|
|
- content_type = combo[0]
|
|
|
+ sort_type = combo[0]
|
|
|
publish_time = combo[1]
|
|
|
duration = combo[2]
|
|
|
share_count_rule = 0
|
|
@@ -25,8 +25,8 @@ class KsKeyword:
|
|
|
return list
|
|
|
payload = json.dumps({
|
|
|
"keyword": keyword,
|
|
|
- "content_type": content_type,
|
|
|
- "sort_type": "视频",
|
|
|
+ "content_type": "综合",
|
|
|
+ "sort_type": sort_type,
|
|
|
"publish_time": publish_time,
|
|
|
"duration": duration,
|
|
|
"cursor": ""
|
|
@@ -64,23 +64,20 @@ class KsKeyword:
|
|
|
return list
|
|
|
data_list = response['data']['data']
|
|
|
for data in data_list:
|
|
|
- type = int(data['type'])
|
|
|
- if type != 1:
|
|
|
- continue
|
|
|
- photo_type = data['photoType']
|
|
|
- if photo_type != "VIDEO":
|
|
|
- continue
|
|
|
- photo_id = data['photoId']
|
|
|
+ data = data['feed']
|
|
|
+ photo_id = data['photo_id']
|
|
|
day_count = Material.get_count_restrict(channel_id)
|
|
|
if day_count:
|
|
|
status = sqlCollect.is_used_days(task_mark, photo_id, mark, channel_id, day_count)
|
|
|
else:
|
|
|
status = sqlCollect.is_used(task_mark, photo_id, mark, channel_id)
|
|
|
|
|
|
- image_url = data['webpCoverUrls'][0]['url']
|
|
|
- video_url = data['mainMvUrls'][0]['url']
|
|
|
- view_count = data.get('viewCount', 0)
|
|
|
- share_count = data.get('shareCount', 0)
|
|
|
+ image_url = data['cover_thumbnail_urls'][0]['url']
|
|
|
+ video_url = data['main_mv_urls'][0]['url']
|
|
|
+ if ".mp4" not in video_url:
|
|
|
+ continue
|
|
|
+ view_count = data.get('view_count', 0)
|
|
|
+ share_count = data.get('share_count', 0)
|
|
|
old_title = data['caption'] # 标题
|
|
|
|
|
|
video_percent = '%.4f' % (int(share_count) / int(view_count))
|