Browse Source

视频号抓取任务

luojunhui 3 tháng trước cách đây
mục cha
commit
dba428278c
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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))))