wangkun 1 year ago
parent
commit
edc8b8fc0d
2 changed files with 8 additions and 19 deletions
  1. 1 1
      xigua/xigua_main/run_xg_search.py
  2. 7 18
      xigua/xigua_search/xigua_search_scheduling.py

+ 1 - 1
xigua/xigua_main/run_xg_search.py

@@ -9,7 +9,7 @@ sys.path.append(os.getcwd())
 from common.common import Common
 from common.public import get_consumer, ack_message, task_fun_mq
 from common.scheduling_db import MysqlHelper
-from xigua.xigua_search.xigua_search_scheduling0628 import XiguasearchScheduling
+from xigua.xigua_search.xigua_search_scheduling import XiguasearchScheduling
 
 
 def main(log_type, crawler, topic_name, group_id, env):

+ 7 - 18
xigua/xigua_search/xigua_search_scheduling.py

@@ -23,7 +23,7 @@ from common.scheduling_db import MysqlHelper
 from common.common import Common
 from common.feishu import Feishu
 from common.publish import Publish
-from common.public import get_config_from_mysql, download_rule, get_title_score
+from common.public import get_config_from_mysql, download_rule
 from common.userAgent import get_random_user_agent
 
 
@@ -574,18 +574,6 @@ class XiguasearchScheduling:
         Common.logging(log_type, crawler, env, "关闭登录弹框")
         if driver.find_elements(By.XPATH, '//*[@class="xg-notification-close"]') != 0:
             driver.find_element(By.XPATH, '//*[@class="xg-notification-close"]').click()
-        # driver.get_screenshot_as_file(f"./{crawler}/photos/{user_dict['link']}-关闭登录弹框.png")
-        Common.logger(log_type, crawler).info("展开筛选按钮")
-        Common.logging(log_type, crawler, env, "展开筛选按钮")
-        driver.find_element(By.XPATH, '//*[@class="searchPageV2__header-icons-categories"]').click()
-        Common.logger(log_type, crawler).info("点击最新排序")
-        Common.logging(log_type, crawler, env, "点击最新排序")
-        driver.find_element(By.XPATH, '//*[@class="searchPageV2__header-categories-wrapper"]/*[1]/*[2]/*[1]').click()
-        time.sleep(1)
-        # driver.get_screenshot_as_file(f"./{crawler}/photos/{user_dict['link']}-最新排序.png")
-        Common.logger(log_type, crawler).info("收起筛选按钮\n")
-        Common.logging(log_type, crawler, env, "收起筛选按钮\n")
-        driver.find_element(By.XPATH, '//*[@class="searchPageV2__header-icons-categories"]').click()
 
         index = 0
         num = 0
@@ -623,11 +611,12 @@ class XiguasearchScheduling:
                     Common.logging(log_type, crawler, env, f"标题:{title}")
                     Common.logger(log_type, crawler).info(f"发布时间:{publish_day}")
                     Common.logging(log_type, crawler, env, f"发布时间:{publish_day}")
-                    if "年" in publish_day:
-                        Common.logger(log_type, crawler).info("发布时间超过 1 年\n")
-                        Common.logging(log_type, crawler, env, "发布时间超过 1 年\n")
-                        driver.quit()
-                        return
+
+                    # if "年" in publish_day:
+                    #     Common.logger(log_type, crawler).info("发布时间超过 1 年\n")
+                    #     Common.logging(log_type, crawler, env, "发布时间超过 1 年\n")
+                    #     driver.quit()
+                    #     return
 
                     item_id = video_element.find_elements(By.XPATH, '//*[@class="HorizontalFeedCard__coverWrapper disableZoomAnimation"]')[index+i-1].get_attribute('href')
                     item_id = item_id.split("com/")[-1].split("?&")[0]