瀏覽代碼

视频号抓取任务

luojunhui 3 月之前
父節點
當前提交
dba428278c
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      tasks/crawler_channel_account_videos.py

+ 4 - 0
tasks/crawler_channel_account_videos.py

@@ -80,6 +80,10 @@ class CrawlerChannelAccountVideos:
             )
             return
 
+        video_length = video['objectDesc']['media'][0]['VideoPlayLen']
+        if video_length and int(video_length) > 300:
+            return
+
         video_item = Item()
         video_id = video["id"]
         video_item.add("content_trace_id", "video{}".format(str_to_md5(str(video_id))))