罗俊辉 1 год назад
Родитель
Сommit
e6b6588bd4
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      applications/search/dy_search.py

+ 3 - 2
applications/search/dy_search.py

@@ -37,7 +37,8 @@ def douyin_search(keyword, sensitive_words, trace_id):
             try:
                 title = obj['video_desc']
                 video_id = obj['video_id']
-                if sensitive_flag(sensitive_words, title):
+                duration = int(obj['duration'])
+                if sensitive_flag(sensitive_words, title) and duration < 30000:
                     res = douyin_detail(video_id)
                     L.append(res)
                 else:
@@ -79,4 +80,4 @@ def douyin_detail(video_id):
     }
     response = requests.request("POST", url, headers=headers, data=payload).json()
     video_info = response['data']['data']
-    return video_info
+    return video_info