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

海外RSS图片下载失败,已开启代理 #550

Closed
Vignore opened this issue Oct 22, 2024 · 4 comments
Closed

海外RSS图片下载失败,已开启代理 #550

Vignore opened this issue Oct 22, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Vignore
Copy link

Vignore commented Oct 22, 2024

ELF_RSS 、 go-cqhttp 、 nonebot 、 Python 版本及操作系统

ELF_RSS: v2.6.25
nonebot: v2.3.3
Python: v3.9

列出安装的 Python 包

aiodns==3.2.0
aiohappyeyeballs==2.4.3
aiohttp==3.10.10
aiosignal==1.3.1
annotated-types==0.7.0
anyio==4.6.2.post1
APScheduler==3.10.4
argcomplete==3.5.1
arrow==1.3.0
async-timeout==4.0.3
attrs==24.2.0
bbcode==1.1.0
beautifulsoup4==4.12.3
Brotli==1.1.0
cachetools==5.5.0
certifi==2019.11.28
cffi==1.17.1
chardet==3.0.4
click==8.1.7
cssselect==1.2.0
deep-translator==1.11.4
emoji==2.14.0
exceptiongroup==1.2.2
fastapi==0.115.2
feedparser==6.0.11
frozenlist==1.4.1
greenlet==3.0.3
h11==0.14.0
h2==4.1.0

如何复现

该情况稳定复现于外网rss订阅中。

环境:
Exsi虚拟机安装了Debian11

Debian11中使用Docker部署了Clash进行代理,已开启Lan选项,局域网内所有设备均可正常访问外网。
Debian11中使用Docker部署了RSShub,正常使用。
Debian11中对/etc/environment进行了代理配置,指令查询提示已生效。
Debian11中部署nonebot 2.3.3

目前已测试bluesky和推特,情况如图bsme提示,图片下载失败。
国内订阅平台一切正常。
image

期望行为

期望如微博订阅
image

实际行为

image

@Vignore Vignore added the bug Something isn't working label Oct 22, 2024
@Quan666
Copy link
Owner

Quan666 commented Oct 24, 2024

你配置文件怎么写的,以及是否通过命令对单个订阅开启代理?

@Vignore
Copy link
Author

Vignore commented Oct 24, 2024

目前的配置文件如下:

# 代理地址
#RSS_PROXY="192.168.50.8:7890"
# rsshub订阅地址
RSSHUB="http://192.168.50.8:1200"

#324 (comment) 启发 尝试直接修改config文件如下:

class ELFConfig(Config):
    class Config:
        extra = "allow"

    # 代理地址
    rss_proxy: Optional[str] = "192.168.50.8:7890"
    rsshub: AnyHttpUrl = "http://192.168.50.8:1200"  # type: ignore
...

然后现在能成功抓取需要代理的图片了。
此处抓取失败1次是我本地部署russhub稍微有点卡,与插件无关
image
image

今天尝试还原config.py中的代理设置为None后,在设置proxy=1开启代理的情况下,仍然提示无法下载图片可能需要开启代理。
主观推测为配置文件的代理参数未生效。

@Quan666
Copy link
Owner

Quan666 commented Oct 24, 2024

#RSS_PROXY="192.168.50.8:7890"

把前面的# 删除再试试

@Vignore
Copy link
Author

Vignore commented Oct 24, 2024

感谢耐心帮助解答,没想到是在这里抓瞎了。

@Vignore Vignore closed this as completed Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants