86 lines
3.9 KiB
Python
86 lines
3.9 KiB
Python
import json
|
|
import redis
|
|
_REDIS_CONF = {
|
|
"host": "192.144.230.75",
|
|
"port": 6379,
|
|
"password": "qwert@$123!&",
|
|
"decode_responses": True,
|
|
}
|
|
|
|
r = redis.Redis(**_REDIS_CONF)
|
|
|
|
proxies = [
|
|
{
|
|
"serial_number": 0,
|
|
"data": {
|
|
"TW": "http://2207189-83c1bf1a:5611d6cb-CN_TW@gate-hk.kookeey.info:1000",
|
|
"HK": "http://2207189-83c1bf1a:5611d6cb-CN_HK@gate-hk.kookeey.info:1000",
|
|
"CA": "http://2207189-83c1bf1a:5611d6cb-CA@gate-hk.kookeey.info:1000",
|
|
"ID": "http://2207189-83c1bf1a:5611d6cb-ID@gate-hk.kookeey.info:1000",
|
|
"MY": "http://2207189-83c1bf1a:5611d6cb-MY@gate-hk.kookeey.info:1000",
|
|
"TH": "http://2207189-83c1bf1a:5611d6cb-TH@gate-hk.kookeey.info:1000",
|
|
"US": "http://2207189-83c1bf1a:5611d6cb-US@gate-hk.kookeey.info:1000",
|
|
"ES": "http://2207189-83c1bf1a:5611d6cb-ES@gate-hk.kookeey.info:1000",
|
|
"KR": "http://2207189-83c1bf1a:5611d6cb-KR@gate-hk.kookeey.info:1000",
|
|
"VN": "http://2207189-83c1bf1a:5611d6cb-VN@gate-hk.kookeey.info:1000"
|
|
},
|
|
"remarks": "https://www.kookeey.com/"
|
|
},
|
|
{
|
|
"serial_number": 1,
|
|
"data": {
|
|
"TW": "kali404-zone-custom-region-tw:xiaofeng123@654451a31d43ed0c.iqa.as.ipidea.online:2333",
|
|
"HK": "kali404-zone-custom-region-hk:xiaofeng123@654451a31d43ed0c.iqa.as.ipidea.online:2333",
|
|
"CA": "kali404-zone-custom-region-ca:xiaofeng123@654451a31d43ed0c.iqa.as.ipidea.online:2333",
|
|
"ID": "kali404-zone-custom-region-id:xiaofeng123@654451a31d43ed0c.iqa.as.ipidea.online:2333",
|
|
"MY": "kali404-zone-custom-region-my:xiaofeng123@654451a31d43ed0c.iqa.as.ipidea.online:2333",
|
|
"TH": "kali404-zone-custom-region-th:xiaofeng123@654451a31d43ed0c.iqa.as.ipidea.online:2333",
|
|
"US": "kali404-zone-custom-region-us:xiaofeng123@654451a31d43ed0c.iqa.as.ipidea.online:2333",
|
|
"ES": "kali404-zone-custom-region-es:xiaofeng123@654451a31d43ed0c.iqa.as.ipidea.online:2333",
|
|
"KR": "kali404-zone-custom-region-kr:xiaofeng123@654451a31d43ed0c.iqa.as.ipidea.online:2333",
|
|
"VN": "kali404-zone-custom-region-vn:xiaofeng123@654451a31d43ed0c.iqa.as.ipidea.online:2333"
|
|
},
|
|
"remarks": "https://www.ipidea.net/"
|
|
},
|
|
{
|
|
"serial_number": 2,
|
|
"data": {
|
|
"TW": "user-kali404-region-tw:xiaofeng123@f1668d8dd55156db.asd.as.roxlabs.vip:4600",
|
|
"HK": "user-kali404-region-hk:xiaofeng123@f1668d8dd55156db.asd.as.roxlabs.vip:4600",
|
|
"CA": "user-kali404-region-ca:xiaofeng123@f1668d8dd55156db.asd.as.roxlabs.vip:4600",
|
|
"ID": "user-kali404-region-id:xiaofeng123@f1668d8dd55156db.asd.as.roxlabs.vip:4600",
|
|
"MY": "user-kali404-region-my:xiaofeng123@f1668d8dd55156db.asd.as.roxlabs.vip:4600",
|
|
"TH": "user-kali404-region-th:xiaofeng123@f1668d8dd55156db.asd.as.roxlabs.vip:4600",
|
|
"US": "user-kali404-region-us:xiaofeng123@f1668d8dd55156db.asd.as.roxlabs.vip:4600",
|
|
"ES": "user-kali404-region-es:xiaofeng123@f1668d8dd55156db.asd.as.roxlabs.vip:4600",
|
|
"KR": "user-kali404-region-kr:xiaofeng123@f1668d8dd55156db.asd.as.roxlabs.vip:4600",
|
|
"VN": "user-kali404-region-vn:xiaofeng123@f1668d8dd55156db.asd.as.roxlabs.vip:4600"
|
|
},
|
|
"remarks": "https://www.roxlabs.cn/"
|
|
}
|
|
]
|
|
proxy_mapping = {
|
|
"印度尼西亚": "ID",
|
|
"马来": "MY",
|
|
"加拿大": "CA",
|
|
"台湾": "TW",
|
|
"泰国": "TH",
|
|
"美国": "US",
|
|
"西班牙": "ES",
|
|
"韩国": "KR",
|
|
"香港": "HK",
|
|
"越南": "VN"
|
|
}
|
|
proxy_conf = 0
|
|
# 准备好各个字段
|
|
proxies_json = json.dumps(proxies, ensure_ascii=False)
|
|
conf_str = str(proxy_conf)
|
|
meta_json = json.dumps(proxy_mapping, ensure_ascii=False)
|
|
|
|
# 全部 hset 到同一个 hash 里
|
|
r.hset("proxy_config", mapping={
|
|
"list": proxies_json,
|
|
"conf": conf_str,
|
|
"meta": meta_json,
|
|
})
|