Update app.py
Browse files
app.py
CHANGED
|
@@ -48,17 +48,14 @@ async def fetch_url(url, session, max_retries=5):
|
|
| 48 |
async def extract_and_transform_proxies(input_text):
|
| 49 |
try:
|
| 50 |
data = yaml.safe_load(input_text)
|
|
|
|
|
|
|
| 51 |
if isinstance(data, dict) and 'proxies' in data:
|
| 52 |
proxies_list = data['proxies']
|
| 53 |
elif isinstance(data, list):
|
| 54 |
proxies_list = data
|
| 55 |
else:
|
| 56 |
-
|
| 57 |
-
if proxies_match:
|
| 58 |
-
proxies_text = proxies_match.group(1)
|
| 59 |
-
proxies_list = yaml.safe_load(proxies_text)
|
| 60 |
-
else:
|
| 61 |
-
return "未找到有效的代理配置"
|
| 62 |
except yaml.YAMLError:
|
| 63 |
return "YAML解析错误"
|
| 64 |
|
|
|
|
| 48 |
async def extract_and_transform_proxies(input_text):
|
| 49 |
try:
|
| 50 |
data = yaml.safe_load(input_text)
|
| 51 |
+
|
| 52 |
+
# 只处理 'proxies' 部分,忽略其他部分
|
| 53 |
if isinstance(data, dict) and 'proxies' in data:
|
| 54 |
proxies_list = data['proxies']
|
| 55 |
elif isinstance(data, list):
|
| 56 |
proxies_list = data
|
| 57 |
else:
|
| 58 |
+
return "未找到有效的代理配置"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
except yaml.YAMLError:
|
| 60 |
return "YAML解析错误"
|
| 61 |
|