mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-05 15:39:40 +08:00
feat: accelerate RSS parsing with Rust
This commit is contained in:
@@ -11,7 +11,6 @@ from requests import Session
|
||||
from app.core.config import settings
|
||||
from app.helper.cloudflare import under_challenge
|
||||
from app.log import logger
|
||||
from app.utils import rust_accel
|
||||
from app.utils.http import RequestUtils
|
||||
from app.utils.site import SiteUtils
|
||||
from app.utils.string import StringUtils
|
||||
@@ -159,11 +158,8 @@ class SiteParserBase(metaclass=ABCMeta):
|
||||
@staticmethod
|
||||
def num_filesize(text) -> int:
|
||||
"""
|
||||
将站点页面中的文件大小文本转换为字节,优先使用 Rust 快路径。
|
||||
将站点页面中的文件大小文本转换为字节。
|
||||
"""
|
||||
rust_value = rust_accel.parse_filesize(text)
|
||||
if rust_value is not None:
|
||||
return rust_value
|
||||
return StringUtils.num_filesize(text)
|
||||
|
||||
def parse(self):
|
||||
|
||||
@@ -672,9 +672,6 @@ class SiteSpider:
|
||||
"""
|
||||
if not text or not filters or not isinstance(filters, list):
|
||||
return text
|
||||
rust_text = rust_accel.apply_indexer_text_filters(text, filters)
|
||||
if rust_text is not None:
|
||||
return rust_text
|
||||
if not isinstance(text, str):
|
||||
text = str(text)
|
||||
for filter_item in filters:
|
||||
|
||||
Reference in New Issue
Block a user