fix 播放限速

This commit is contained in:
thsrite 2023-08-31 19:08:50 +08:00
parent 7baa07474c
commit 3bc639bcab

View File

@ -54,7 +54,7 @@ class SpeedLimiter(_PluginBase):
_bandwidth: float = 0
_allocation_ratio: str = ""
_auto_limit: bool = False
_limit_enabled: bool = True
_limit_enabled: bool = False
# 不限速地址
_unlimited_ips = {"ipv4": "0.0.0.0/0", "ipv6": "::/0"}
# 当前限速状态
@ -76,6 +76,9 @@ class SpeedLimiter(_PluginBase):
self._auto_limit = True
except Exception:
self._bandwidth = 0
# 限速服务开关
self._limit_enabled = True if self._play_up_speed or self._play_down_speed or self._auto_limit else False
self._allocation_ratio = config.get("allocation_ratio") or ""
# 不限速地址
self._unlimited_ips["ipv4"] = config.get("ipv4") or "0.0.0.0/0"