Skip to content

fix issue33: list index out of range if there is no data after '/?'#82

Open
z1nke wants to merge 1 commit intoTyrantLucifer:masterfrom
z1nke:issue33
Open

fix issue33: list index out of range if there is no data after '/?'#82
z1nke wants to merge 1 commit intoTyrantLucifer:masterfrom
z1nke:issue33

Conversation

@z1nke
Copy link

@z1nke z1nke commented Feb 14, 2023

修复 #33

修复前,例如:

shadowsocksr-cli --add-ssr ssr://MTIzLjEyMy4xMjMuMTIzOjEyMzQ1OmF1dGhfYWVzMTI4X3NoYTE6YWVzLTI1Ni1jZmI6cGxhaW46YW1zNGNrVm5ZMjF6TlV4WVRrNVlhRUZD
# 123.123.123.123:12345:auth_aes128_sha1:aes-256-cfb:plain:ams4ckVnY21zNUxYTk5YaEFC

Traceback (most recent call last):
  File "/home/username/.local/bin/shadowsocksr-cli", line 8, in <module>
    sys.exit(main())
  File "/home/username/.local/lib/python3.10/site-packages/shadowsocksr_cli/main.py", line 84, in main
    UpdateConfigurations.add_shadowsocksr_by_url(args.add_ssr)
  File "/home/username/.local/lib/python3.10/site-packages/shadowsocksr_cli/functions.py", line 125, in add_shadowsocksr_by_url
    update_shadowsocksr.add_shadowsocksr_by_url(ssr_url)
  File "/home/username/.local/lib/python3.10/site-packages/shadowsocksr_cli/update_utils.py", line 53, in add_shadowsocksr_by_url
    ssr_dict = ParseShadowsocksr.parse_shadowsocksr(ssr_url)
  File "/home/username/.local/lib/python3.10/site-packages/shadowsocksr_cli/parse_utils.py", line 76, in parse_shadowsocksr
    value = params.split('=')[1]
IndexError: list index out of range

修复后,可以正常添加 ssr 链接

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant