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

请允许proxy为空 #2

Closed
dzhuang opened this issue Oct 16, 2023 · 4 comments
Closed

请允许proxy为空 #2

dzhuang opened this issue Oct 16, 2023 · 4 comments

Comments

@dzhuang
Copy link
Contributor

dzhuang commented Oct 16, 2023

proxy写入了一个默认值,所以下面的validate_proxy一定会运行.

proxy: str = os.getenv("XIAOMUSIC_PROXY", "http://192.168.2.5:8080")
def __post_init__(self) -> None:
if self.proxy:
validate_proxy(self.proxy)

@hanxi
Copy link
Owner

hanxi commented Oct 16, 2023

是否需要改成 proxy: str|None 这样的语法?

@dzhuang
Copy link
Contributor Author

dzhuang commented Oct 16, 2023

是否需要改成 proxy: str|None 这样的语法?

有type checking当然会更好!

@dzhuang dzhuang closed this as completed Oct 16, 2023
@JoeNik
Copy link

JoeNik commented Jan 31, 2024

http代理带账号密码的是不是不行?

@hanxi
Copy link
Owner

hanxi commented Jan 31, 2024

http代理带账号密码的是不是不行?

@JoeNik

可以的,参考yt-dlp的说明文档:

Use the specified HTTP/HTTPS/SOCKS proxy. To
enable SOCKS proxy, specify a proper scheme,
e.g. socks5://user:[email protected]:1080/.
Pass in an empty string (--proxy "") for
direct connection

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

3 participants