github downloader fix

This commit is contained in:
Flowseal
2026-05-08 14:36:47 +03:00
parent 33d3147c0b
commit e72a44d74b
5 changed files with 58 additions and 13 deletions

View File

@@ -7,9 +7,10 @@ import threading
from dataclasses import dataclass, field
from typing import Dict, List
from urllib.request import Request, urlopen
from urllib.request import Request
from .balancer import balancer
from .utils import build_github_opener
log = logging.getLogger('tg-mtproto-proxy')
@@ -70,7 +71,7 @@ def _fetch_cfproxy_domain_list() -> List[str]:
try:
req = Request(CFPROXY_DOMAINS_URL + "?" + "".join(random.choices(string.ascii_letters, k=7)),
headers={'User-Agent': 'tg-ws-proxy'})
with urlopen(req, timeout=10) as resp:
with build_github_opener().open(req, timeout=10) as resp:
text = resp.read().decode('utf-8', errors='replace')
encoded = [
line.strip() for line in text.splitlines()