Skip to content

修復 -s (搜尋關鍵字) 功能 / Fix -s (Search Keyword) Functionality #6

@LayorX

Description

@LayorX

目前使用 -s <keyword> 參數時,程式似乎沒有根據關鍵字正確篩選出相關的影片。抓取到的內容可能與未使用 -s 參數時相同,或是完全不相關。

初步 Issue 分析:

  1. API 限制: Threads 的內部 GraphQL API 可能不直接支援或公開關鍵字搜尋功能。我們攔截到的請求可能只是通用的「推薦內容」Feed,而 -s 參數沒有被正確地轉換成 API 查詢的一部分。
  2. 參數注入失敗: scraper.py 中處理 -s 參數的邏輯可能存在問題,導致關鍵字沒有被正確地注入到 selenium-wire 攔截或修改的請求中。需要檢查將命令列參數傳遞到爬蟲模組的整個流程。

Currently, when using the -s <keyword> parameter, the program does not seem to correctly filter for relevant videos based on the keyword. The fetched content might be the same as when the -s parameter is not used, or it could be completely irrelevant.

Preliminary Issue Analysis:

  1. API Limitation: The internal GraphQL API of Threads may not directly support or expose a keyword search feature. The requests we intercept might just be for the generic "recommended content" feed, and the -s parameter is not being correctly translated into a part of the API query.
  2. Parameter Injection Failure: There might be an issue with the logic in scraper.py that handles the -s parameter, causing the keyword not to be correctly injected into the requests intercepted or modified by selenium-wire. The entire flow of passing the command-line parameter to the scraper module needs to be reviewed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions