Explorar el Código

update 西瓜搜索改为时间排序搜索

lierqiang hace 2 años
padre
commit
367cd45042
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      xigua/xigua_search/xigua_search.py

+ 1 - 1
xigua/xigua_search/xigua_search.py

@@ -654,7 +654,7 @@ class XiguaSearch:
             for video_info in search_list:
             for video_info in search_list:
                 v_type = video_info['type']
                 v_type = video_info['type']
                 rule_dict = cls.get_rule(log_type, crawler)
                 rule_dict = cls.get_rule(log_type, crawler)
-                publish_time = video_info['publish_time']
+                publish_time = video_info['data']['publish_time']
                 old_time = int(time.time()) - (3600 * 24 * rule_dict['publish_time'])
                 old_time = int(time.time()) - (3600 * 24 * rule_dict['publish_time'])
                 if publish_time <= old_time:
                 if publish_time <= old_time:
                     Common.logger(log_type, crawler).error(f'关键词:{search_word},抓取完毕,退出抓取\n')
                     Common.logger(log_type, crawler).error(f'关键词:{search_word},抓取完毕,退出抓取\n')