mirror of
https://github.com/honmashironeko/ProxyCat.git
synced 2025-06-21 18:31:22 +00:00
Merge branch 'main' of https://github.com/honmashironeko/ProxyCat
This commit is contained in:
commit
977db36b66
@ -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))
|
||||
|
||||
|
@ -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))
|
||||
|
||||
|
@ -293,8 +293,6 @@ After actual testing, when the proxy address server has sufficient performance,
|
||||
|
||||
If you have good ideas or encounter bugs during use, please contact the author through the following methods to provide feedback!
|
||||
|
||||
WeChat Public Account: **Honma Shironeko of Sakura Dormitory**
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
No particular order is given. Thanks to the mentors who provided help for this project.
|
||||
|
Loading…
x
Reference in New Issue
Block a user