From 143a8917b0c7447e476998b578fdb4b5ca8b19c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=AC=E9=97=B4=E7=99=BD=E7=8C=AB?= <139044047+honmashironeko@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:53:30 +0800 Subject: [PATCH] Update ProxyCat-V1.8.py --- ProxyCat-CN/ProxyCat-V1.8.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ProxyCat-CN/ProxyCat-V1.8.py b/ProxyCat-CN/ProxyCat-V1.8.py index e2db7f7..5f86371 100644 --- a/ProxyCat-CN/ProxyCat-V1.8.py +++ b/ProxyCat-CN/ProxyCat-V1.8.py @@ -68,7 +68,17 @@ def load_proxies(file_path: str = 'ip.txt') -> List[str]: def is_valid_proxy(proxy: str) -> bool: pattern = re.compile( - r'^((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d):([1-9]|[1-9]\d{1,4}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$|^([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}:( [1-9]|[1-9]\d{1,4}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$' + r'^(http|https|socks5)://' + r'(' + r'(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)\.' + r'(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)\.' + r'(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)\.' + r'(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)' + r'|' + r'([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}' + r')' + r':' + r'(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|\d{1,4})$' ) return bool(pattern.match(proxy)) @@ -643,4 +653,4 @@ if __name__ == '__main__': try: asyncio.run(main()) except KeyboardInterrupt: - logging.info("程序被用户中断") \ No newline at end of file + logging.info("程序被用户中断")