1
0

fix:ipv6 test support()

This commit is contained in:
guorong.zheng 2024-09-20 17:09:26 +08:00
parent 1c3eb0f980
commit b744898c1b
3 changed files with 15 additions and 13 deletions

@ -12,11 +12,11 @@ open_ffmpeg = True
response_time_weight = 0.5
resolution_weight = 0.5
recent_days = 30
ipv_type = ipv4
ipv_type = 全部
domain_blacklist = epg.pw,skype.serv00.net
open_m3u_result = True
url_keywords_blacklist =
open_subscribe = False
open_subscribe = True
subscribe_urls = https://m3u.ibert.me/txt/fmml_dv6.txt,https://m3u.ibert.me/txt/o_cn.txt,https://m3u.ibert.me/txt/j_iptv.txt,https://github.moeyy.xyz/https://raw.githubusercontent.com/PizazzGY/TVBox/main/live.txt
open_multicast = True
open_multicast_tonkiang = True

@ -637,7 +637,7 @@ async def process_sort_channel_list(data, callback=None):
"""
open_ffmpeg = config.getboolean("Settings", "open_ffmpeg")
ipv_type = config.get("Settings", "ipv_type").lower()
open_ipv6 = "ipv6" in ipv_type or "all" in ipv_type
open_ipv6 = "ipv6" in ipv_type or "all" in ipv_type or "全部" in ipv_type
ipv6_proxy = None
if open_ipv6:
ipv6_proxy = (

@ -10,6 +10,7 @@ import re
from bs4 import BeautifulSoup
from flask import render_template_string, send_file
import shutil
import requests
def format_interval(t):
@ -143,18 +144,19 @@ def is_ipv6(url):
def check_ipv6_support():
"""
Check if the system supports ipv6 and if the network can access an IPv6 address
Check if the system network supports ipv6
"""
url = "https://ipv6.tokyo.test-ipv6.com/ip/?callback=?&testdomain=test-ipv6.com&testname=test_aaaa"
try:
test_socket = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
test_socket.settimeout(2)
test_socket.connect(("2001:4860:4860::8888", 80))
test_socket.close()
print("Your network supports IPv6")
return True
except (socket.timeout, OSError):
print("Your network does not support IPv6, using proxy")
return False
print("Checking if your network supports IPv6...")
response = requests.get(url, timeout=15)
if response.status_code == 200:
print("Your network supports IPv6")
return True
except Exception:
pass
print("Your network does not support IPv6, using proxy instead")
return False
def check_url_ipv_type(url):