Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Toperlock authored Oct 24, 2023
1 parent c8409c5 commit b447d72
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def action_keywords(nodes,action,keywords):
for k in keywords:
if k != "":
_keywords.append(k)
keywords = _keywords
'''
_keywords_list = keywords[0].split("|")
keywords = [k for k in _keywords_list if k]
Expand Down Expand Up @@ -123,9 +124,10 @@ def get_nodes(url):
outbounds_0 = content['outbounds'][0]['outbounds']
outbounds_tags = [item["tag"] for item in content["outbounds"][1:]]
matching_tags = [tag for tag in outbounds_tags if tag in outbounds_0]
filtered_tags = [tag for tag in matching_tags if tag != "auto"]
matching_indices = []
for i, outbound in enumerate(content["outbounds"][1:]):
if outbound["tag"] in matching_tags:
if outbound["tag"] in filtered_tags:
matching_indices.append(i + 1) # 添加1以补偿切片的偏移
data = [content["outbounds"][i] for i in matching_indices]
return data
Expand Down

0 comments on commit b447d72

Please sign in to comment.