mirror of
https://github.com/vvbbnn00/WARP-Clash-API.git
synced 2026-06-12 21:02:18 +08:00
Unify variables and constants to use the snake_case naming convention, and use camelCase for method names.
19 lines
405 B
Python
19 lines
405 B
Python
import requests
|
|
|
|
from config import PROXY_POOL_URL
|
|
|
|
|
|
def getProxy():
|
|
"""
|
|
Get proxy from proxy pool
|
|
:return: proxy got from proxy pool
|
|
"""
|
|
ret = requests.get(PROXY_POOL_URL).json()
|
|
proxy = {}
|
|
if ret.get('proxy'):
|
|
if ret['https']:
|
|
proxy = {"https": {ret['proxy']}}
|
|
else:
|
|
proxy = {"http": {ret['proxy']}}
|
|
return proxy
|