feat: accelerate site indexer parsing with rust

This commit is contained in:
jxxghp
2026-05-23 15:59:20 +08:00
parent 222f6ce7d8
commit d1e2881347
9 changed files with 2523 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ from pyquery import PyQuery
from app.core.config import settings
from app.log import logger
from app.schemas.types import MediaType
from app.utils import rust_accel
from app.utils.http import RequestUtils, AsyncRequestUtils
from app.utils.string import StringUtils
from app.utils.url import UrlUtils
@@ -737,6 +738,17 @@ class SiteSpider:
self.is_error = True
return []
rust_torrents = rust_accel.parse_indexer_torrents(
html_text=html_text,
domain=self.domain,
list_config=self.list,
fields=self.fields,
category=self.category,
result_num=self.result_num
)
if rust_torrents is not None:
return rust_torrents
# 清空旧结果
self.torrents_info_array = []
html_doc = None