Skip to content

Commit d935f07

Browse files
committed
✨Fix Surge Config Icon Missing
1 parent 7ccb6cc commit d935f07

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

Generator/generators/surge_generator.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ def _generate_proxy_group(self, group: Dict[str, Any]) -> str:
179179
if 'exclude-filter' in group:
180180
# 其他节点组,使用排除过滤
181181
exclude_pattern = self._get_country_pattern_for_surge(name)
182-
return f"{name} = select, include-other-group=Proxies, update-interval=0, policy-regex-filter=^(?!.*({exclude_pattern})), icon={icon}"
182+
return f"{name} = select, include-other-group=Proxies, update-interval=0, policy-regex-filter=^(?!.*({exclude_pattern})), icon-url={icon}"
183183
else:
184184
# 手动选择,包含所有节点
185-
return f"{name} = select, include-other-group=Proxies, update-interval=0, icon={icon}"
185+
return f"{name} = select, include-other-group=Proxies, update-interval=0, icon-url={icon}"
186186
else:
187187
# 普通选择组
188188
proxies = ', '.join(group.get('proxies', []))
189-
return f"{name} = select, {proxies}, icon={icon}"
189+
return f"{name} = select, {proxies}, icon-url={icon}"
190190

191191
elif group_type == 'url-test':
192192
# Surge 使用 smart 类型实现类似 url-test 的功能
@@ -195,15 +195,15 @@ def _generate_proxy_group(self, group: Dict[str, Any]) -> str:
195195
# 如果有 filter 字段,说明是国家节点组
196196
if 'filter' in group:
197197
filter_pattern = self._get_country_pattern_for_surge(name)
198-
return f"{name} = smart, include-other-group=Proxies, update-interval=0, policy-regex-filter=({filter_pattern}), icon={icon}"
198+
return f"{name} = smart, include-other-group=Proxies, update-interval=0, policy-regex-filter=({filter_pattern}), icon-url={icon}"
199199
else:
200200
proxies = ', '.join(group.get('proxies', []))
201-
return f"{name} = smart, {proxies}, icon={icon}"
201+
return f"{name} = smart, {proxies}, icon-url={icon}"
202202

203203
else:
204204
# 默认为 select
205205
proxies = ', '.join(group.get('proxies', []))
206-
return f"{name} = select, {proxies}, icon={icon}"
206+
return f"{name} = select, {proxies}, icon-url={icon}"
207207

208208
def _generate_proxy_groups_section(self, proxy_groups: List[Dict[str, Any]]) -> str:
209209
"""
@@ -230,7 +230,7 @@ def _generate_proxy_groups_section(self, proxy_groups: List[Dict[str, Any]]) ->
230230
# 添加 Proxies 组(用于存放订阅地址)
231231
lines.append("")
232232
lines.append("# Proxies")
233-
lines.append("Proxies = select, policy-path=<Your Node List Link Here>, update-interval=0, no-alert=0, hidden=0, include-all-proxies=1, icon=https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Proxy.png")
233+
lines.append("Proxies = select, policy-path=<Your Node List Link Here>, update-interval=0, no-alert=0, hidden=0, include-all-proxies=1, icon-url=https://testingcf.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Proxy.png")
234234

235235
return '\n'.join(lines)
236236

0 commit comments

Comments
 (0)