feat:ipv6 test
This commit is contained in:
parent
ab09ef38a3
commit
252acaf864
@ -643,12 +643,7 @@ async def process_sort_channel_list(data, ipv6=False, callback=None):
|
||||
"""
|
||||
Processs the sort channel list
|
||||
"""
|
||||
open_ipv6 = (
|
||||
"ipv6" in config.ipv_type
|
||||
or "all" in config.ipv_type
|
||||
or "全部" in config.ipv_type
|
||||
)
|
||||
ipv6_proxy = None if not open_ipv6 or ipv6 else "http://www.ipv6proxy.net/go.php?u="
|
||||
ipv6_proxy = None if (not config.open_ipv6 or ipv6) else constants.ipv6_proxy
|
||||
ffmpeg_installed = is_ffmpeg_installed()
|
||||
if config.open_ffmpeg and not ffmpeg_installed:
|
||||
print("FFmpeg is not installed, using requests for sorting.")
|
||||
|
@ -60,6 +60,12 @@ class ConfigManager:
|
||||
def ipv_type(self):
|
||||
return self.config.get("Settings", "ipv_type", fallback="全部").lower()
|
||||
|
||||
@property
|
||||
def open_ipv6(self):
|
||||
return (
|
||||
"ipv6" in self.ipv_type or "all" in self.ipv_type or "全部" in self.ipv_type
|
||||
)
|
||||
|
||||
@property
|
||||
def ipv_type_prefer(self):
|
||||
return [
|
||||
|
@ -58,3 +58,5 @@ origin_map = {
|
||||
"subscribe": "订阅源",
|
||||
"online_search": "关键字源",
|
||||
}
|
||||
|
||||
ipv6_proxy = "http://www.ipv6proxy.net/go.php?u="
|
||||
|
@ -142,8 +142,9 @@ async def get_speed_by_info(
|
||||
return float("inf")
|
||||
try:
|
||||
if ipv6_proxy and url_is_ipv6:
|
||||
url = ipv6_proxy + url
|
||||
if ffmpeg:
|
||||
url_speed = 0
|
||||
speed = (url_info, url_speed)
|
||||
elif ffmpeg:
|
||||
speed = await check_stream_speed(url_info)
|
||||
url_speed = speed[1] if speed != float("inf") else float("inf")
|
||||
if url_speed == float("inf"):
|
||||
@ -160,7 +161,7 @@ async def get_speed_by_info(
|
||||
speed[0][0] = add_url_info(speed[0][0], url_show_info)
|
||||
speed = (tuple(speed[0]), speed[1])
|
||||
return speed
|
||||
except Exception:
|
||||
except:
|
||||
return float("inf")
|
||||
finally:
|
||||
if callback:
|
||||
|
Loading…
x
Reference in New Issue
Block a user