Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

兼容包含逗号等符号的节点名 #251

Closed
xream opened this issue Oct 31, 2023 · 5 comments
Closed

兼容包含逗号等符号的节点名 #251

xream opened this issue Oct 31, 2023 · 5 comments

Comments

@xream
Copy link
Member

xream commented Oct 31, 2023

a, b = http, 127.0.0.1, 80

@BlackLuny
Copy link

好像还有一些也不能识别,我有个链接,只能识别出一个节点,同样的链接,小火煎没问题。

@xream
Copy link
Member Author

xream commented Nov 13, 2023

@BlackLuny 不是一个问题

  1. 部分机场会根据 User-Agent 下发不同协议的节点. 你可以设置 User-Agent 确保下发的完整.

可以尝试设置浏览器 UA Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/116.0.0.0

或者 Shadowrocket 的 UA Shadowrocket/2052 CFNetwork/1331.0.7 Darwin/21.4.0

  1. 选择不同的客户端输出也会过滤掉不支持的协议. 可以选择 ClashMeta 输出

@BlackLuny
Copy link

BlackLuny commented Nov 13, 2023

不是的,应该是解析的问题,我自己用python按照base64方法解析url的结果,解析会报错,
这个是解析的python代码

subscription_data = 'dHJvamFuOi8vcjFXXXXXXXXX'

import base64

def decode_base64(encoded_str):
    """解码base64字符串."""
    # 对于base64编码,确保字符串长度是4的倍数
    padding = 4 - len(encoded_str) % 4
    if padding:
        encoded_str += "=" * padding

    # 解码
    try:
        decoded_bytes = base64.b64decode(encoded_str, validate=True)
        return decoded_bytes.decode('utf-8')  # 假设编码为utf-8
    except Exception as e:
        return f"解码失败: {e}"

decoded_str = decode_base64(subscription_data)
print(decoded_str)

报错信息:
解码失败: Non-base64 digit found

Process finished with exit code 0

而且我也尝试了你的UA,均不行,另外,没有做任何其他额外的去国旗之类的操作。

@xream
Copy link
Member Author

xream commented Nov 13, 2023

没看懂你发 python 代码想表达什么. 可以私发我订阅链接看看

@xream
Copy link
Member Author

xream commented Apr 17, 2024

关闭 已加入 #312

@xream xream closed this as completed Apr 17, 2024
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

No branches or pull requests

2 participants