mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-09 06:22:29 +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):
|
||||
|
||||
Reference in New Issue
Block a user