Skip to content

Commit

Permalink
Update ss.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Toperlock authored Nov 17, 2023
1 parent 7560c3a commit 822b863
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions parsers/ss.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ def parse(data):
'password':None
}
flag = 0
if param.find('#') > -1 and param[param.find('#') + 1:] != '':
remark = urllib.parse.unquote(param[param.find('#') + 1:])
node['tag'] = remark
if param.find('#') > -1:
if param[param.find('#') + 1:] != '':
remark = urllib.parse.unquote(param[param.find('#') + 1:])
node['tag'] = remark
param = param[:param.find('#')]
if param.find('/?') > -1:
plugin_opts={}
Expand Down Expand Up @@ -100,7 +101,12 @@ def parse(data):
else:
return None
except:
return None
matcher = re.match(r'(.*?):(.*)', param)
if matcher:
node['method'] = matcher.group(1)
node['password'] = matcher.group(2)
else:
return None
else:
matcher = re.match(r'(.*?):(.*)@(.*):(.*)', tool.urlDecode(param).decode('utf-8'))
if matcher:
Expand Down

0 comments on commit 822b863

Please sign in to comment.