Skip to content

Commit

Permalink
Merge branch 'Toperlock:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
caiysmy committed Jan 12, 2024
2 parents 96ca9e4 + 42bd75c commit 65c2cfe
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def edit_temp_json():

@app.route('/config/<path:url>', methods=['GET'])
def config(url):
if any(substring in url for substring in ['gitlab.com', 'sing-box-subscribe.vercel.app', 'sub/merged_proxies.yaml', 'https:/https:/', 'xxxx', 'URL_LINK', 'URLLINK', '%E6%9C%BA%E5%9C%BA', '%E8%AE%A2%E9%98%85', '%E4%BD%A0%E7%9A%84', 'SUB', '%E9%93%BE%E6%8E%A5']):
if any(substring in url for substring in ['sing-box-subscribe.vercel.app', 'https:/https:/', 'xxxx', '%E6%9C%BA%E5%9C%BA', '%E8%AE%A2%E9%98%85']):
return None
# temp_json_data_str = os.environ['TEMP_JSON_DATA']
# temp_json_data = json.loads(temp_json_data_str)
Expand Down
10 changes: 5 additions & 5 deletions parsers/ss.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ def parse(data):
smux_dict = {k: v[0] for k, v in smux_dict.items() if v[0]}
node['multiplex'] = {
'enabled': True,
'protocol': smux_dict['protocol'],
'max_streams': int(smux_dict.get('max-streams', '0'))
'protocol': smux_dict['protocol']
}
if smux_dict.get('max-connections'):
if smux_dict.get('max-streams'):
node['multiplex']['max_streams'] = int(smux_dict['max-streams'])
else:
node['multiplex']['max_connections'] = int(smux_dict['max-connections'])
if smux_dict.get('min-streams'):
node['multiplex']['min_streams'] = int(smux_dict['min-streams'])
if smux_dict.get('padding') == 'True':
node['multiplex']['padding'] = True
Expand Down Expand Up @@ -149,4 +149,4 @@ def parse(data):
if flag:
return node,node_tls
else:
return node
return node
14 changes: 7 additions & 7 deletions parsers/trojan.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ def parse(data):
if netquery.get('protocol'):
node['multiplex'] = {
'enabled': True,
'protocol': netquery['protocol'],
'max_streams': int(netquery.get('max_streams', '0'))
'protocol': netquery['protocol']
}
if netquery.get('max_connections'):
node['multiplex']['max_connections'] = int(netquery['max_connections'])
if netquery.get('min_streams'):
node['multiplex']['min_streams'] = int(netquery['min_streams'])
if netquery.get('max-streams'):
node['multiplex']['max_streams'] = int(netquery['max-streams'])
else:
node['multiplex']['max_connections'] = int(netquery['max-connections'])
node['multiplex']['min_streams'] = int(netquery['min-streams'])
if netquery.get('padding') == 'True':
node['multiplex']['padding'] = True
return node
return node
14 changes: 7 additions & 7 deletions parsers/vless.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ def parse(data):
if netquery.get('protocol'):
node['multiplex'] = {
'enabled': True,
'protocol': netquery['protocol'],
'max_streams': int(netquery.get('max_streams', '0'))
'protocol': netquery['protocol']
}
if netquery.get('max_connections'):
node['multiplex']['max_connections'] = int(netquery['max_connections'])
if netquery.get('min_streams'):
node['multiplex']['min_streams'] = int(netquery['min_streams'])
if netquery.get('max-streams'):
node['multiplex']['max_streams'] = int(netquery['max-streams'])
else:
node['multiplex']['max_connections'] = int(netquery['max-connections'])
node['multiplex']['min_streams'] = int(netquery['min-streams'])
if netquery.get('padding') == 'True':
node['multiplex']['padding'] = True
return node
return node
10 changes: 5 additions & 5 deletions parsers/vmess.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ def parse(data):
if item.get('protocol'):
node['multiplex'] = {
'enabled': True,
'protocol': item['protocol'],
'max_streams': int(item.get('max_streams', '0'))
'protocol': item['protocol']
}
if item.get('max_connections'):
if item.get('max_streams'):
node['multiplex']['max_streams'] = int(item['max_streams'])
else:
node['multiplex']['max_connections'] = int(item['max_connections'])
if item.get('min_streams'):
node['multiplex']['min_streams'] = int(item['min_streams'])
if item.get('padding') == True:
node['multiplex']['padding'] = True
return node
return node

0 comments on commit 65c2cfe

Please sign in to comment.