Hex-Dragon / PCL2

Plain Craft Launcher(我的世界启动器 PCL)的源代码,为支持社区研究而公开。
https://afdian.com/a/LTCat
Other
2.73k stars 202 forks source link

支持在自动安装时从多个下载源获取 Fabric API 等 Mod 信息 #4327

Closed PhantomPixel-0418 closed 4 months ago

PhantomPixel-0418 commented 4 months ago

检查项

描述

Fabric API 获取版本列表失败:连接服务器超时,已接收0B(https://api.modrinth.com/v2/project/fabric-api)

但我打开浏览器是可以正常显示的: 屏幕截图 2024-07-24 135311

HMCL: 屏幕截图 2024-07-24 140303

重现步骤

1、点击下载 2、随便点击一个版本 3、附加安装fabric 4、稍等一会,可以看到fabric api上有提示

日志与附件

Log1.txt line 892:[13:48:30.052] [Net] 获取网络结果:https://api.modrinth.com/v2/project/fabric-api,超时 10000ms,要求 json

JingHai-Lingyun commented 4 months ago

用 PCL 的时候网络抽了罢,我这里一切正常

Ad-closeNN commented 4 months ago

https://github.com/Hex-Dragon/PCL2/discussions/4326#discussioncomment-10133622

3gf8jv4dv commented 4 months ago

The log was not uploaded successfully —— Not Found

hejiehao commented 4 months ago

日志与附件

Log1.txt

Not Found

3gf8jv4dv commented 4 months ago

Similar to #2839, but the error prompts are different. However most likely it is a network problem.

3gf8jv4dv commented 4 months ago

I will close this. Comment in #4326 if you need help.

JingHai-Lingyun commented 4 months ago

4338 同样报告此问题,Reopen 此 Issue

allMagicNB commented 4 months ago

怀疑是 UA 头问题。

LTCatt commented 4 months ago

两个反馈都没有有效日志…… 如果反馈者能稳定复现才考虑是 Bug。

3gf8jv4dv commented 4 months ago

怀疑是 UA 头问题。

But not all users encounter this problem. I am more inclined to Lingyun’s conclusion that 连通性不好.

I checked Modrinth’s domain on ITDOG and noticed that certain areas/carriers on the mainland were experiencing frequent connection timeouts.

JingHai-Lingyun commented 4 months ago

连通性不好 means the api url has DNS analysis or Connection Blockage problem. It may cause this issue in some area in China.

PhantomPixel-0418 commented 4 months ago

我又试了次可以证明 Log1.txt

PhantomPixel-0418 commented 4 months ago

https://github.com/user-attachments/assets/dd7bcdaf-211d-42de-8961-9f3724c72b38

PhantomPixel-0418 commented 4 months ago

怀疑是 UA 头问题。

But not all users encounter this problem. I am more inclined to Lingyun’s conclusion that 连通性不好.

I checked Modrinth’s domain on ITDOG and noticed that certain regions/carriers on the mainland were experiencing frequent connection timeouts.

ITDOGping modrinth.com 的结果

是的,正如你所说,我也试着用 ITDOG 测试了一下 modrinth.com ,发现:

共11处丢包率100%,并且可能所有获取失败的运行商是中国电信,以上11处运营商都为中国电信。并且只有21处运营商是中国电信运营商丢包率为0%,其他运营商所有丢包率都等于0%

image image

实在不行我跑几百米去上海界旁边下(划掉)去curseforge下

PhantomPixel-0418 commented 4 months ago

上面图2报403的是因为没通过cloudflare的人机测试

3gf8jv4dv commented 4 months ago

Wait...Cloudflare? Looks like it is frequently interfered/blocked in certain areas/carriers on the mainland.

RELATED: https://github.com/XIU2/CloudflareSpeedTest/discussions/382

LTCatt commented 4 months ago

我觉得可以考虑把 Mod 部分的列表加载都同时用 CurseForge、Modrinth 和国内镜像源三个源来解决……

Pigeon0v0 commented 4 months ago

4291 Related

PhantomPixel-0418 commented 4 months ago

ok, 我随时等待修好

HiTech0926 commented 4 months ago

我今天也遇到这个问题了,打开modrinth官网发现是cloudflare的防护页面。在浏览器等待该页面检测完毕,PCL2就能正常获取了。@LTCatt

allMagicNB commented 4 months ago

?谁家好人给 API 加 JS 鉴权

HiTech0926 commented 4 months ago

?谁家傻逼给 API 加 JS 鉴权

应该不是刻意加的,cloudflare会对所有子域名生效。。。

Pigeon0v0 commented 4 months ago

不会给 API 加 JavaScript 鉴权的...鉴权不了一点...

allMagicNB commented 4 months ago

……那就是玄学?

Ad-closeNN commented 4 months ago

image

LTCatt commented 4 months ago

如果谁遇到了这个问题,可以向 modrinth 交个反馈?我这里没法复现所以没法 orz

Pigeon0v0 commented 4 months ago

建议更改标题:支持在自动安装时从多个下载源获取 Fabric API

z0z0r4 commented 4 months ago

modrinth 不会也没有给 api.modrinth.com 添加 CF 盾

应该不是刻意加的,cloudflare会对所有子域名生效。。。

cloudflare 也不会自动对所有 DNS 解析生效,只有选择需要代理的才会生效

[05:58:39.206] 加载线程 Fabric API List Loader (47) 发生运行时错误:连接服务器超时,已接收 0 B(https://api.modrinth.com/v2/project/fabric-api

不是 cloudflare 的防护造成的,显然是根本没连上服务器...

应该被测试的不是 modrinth.com 而是 api.modrinth.com,应该使用的也不应该是 在线 Ping 而是 网站测速

确实有部分电信地区无法访问 api.modrinth.com

image

实际上来说,向 modrinth 提交反馈没有任何意义...

实测 staging-api.modrinth.com 同样被这些地区屏蔽

相比之下 Curseforge 的表现是全绿的,AWS

HiTech0926 commented 4 months ago

modrinth 不会也没有给 api.modrinth.com 添加 CF 盾

应该不是刻意加的,cloudflare会对所有子域名生效。。。

cloudflare 也不会自动对所有 DNS 解析生效,只有选择需要代理的才会生效

[05:58:39.206] 加载线程 Fabric API List Loader (47) 发生运行时错误:连接服务器超时,已接收 0 B(https://api.modrinth.com/v2/project/fabric-api)

不是 cloudflare 的防护造成的,显然是根本没连上服务器...

应该被测试的不是 modrinth.com 而是 api.modrinth.com,应该使用的也不应该是 在线 Ping 而是 网站测速

确实有部分电信地区无法访问 api.modrinth.com

image

实际上来说,向 modrinth 提交反馈没有任何意义...

实测 staging-api.modrinth.com 同样被这些地区屏蔽

~相比之下 Curseforge 的表现是全绿的,AWS~

但是我一直连不上的时候,打开网页发现是cf的js鉴权。等点了验证后发现刚好PCL也加载出来了啊……以前modrinth没有cf鉴权的

z0z0r4 commented 4 months ago

modrinth.com 有 CF 盾,api.modrinth.com 没有

请不要,不要通过 modrinth.com 来检查 api.modrinth.com

HiTech0926 commented 4 months ago

modrinth.com 有 CF 盾,api.modrinth.com 没有

请不要,不要通过 modrinth.com 来检查 api.modrinth.com

@LTCatt 模组下载也会出问题,可以基本确定就是modrinth的锅 image 此时访问modrinth是验证 image 过完验证,刷新pcl2,又能加载出来了 image

JingHai-Lingyun commented 4 months ago

虽然事实体现出了通过 modrinth.com 的 CF Captcha 有助于访问 api.modrinth.com。 但从技术角度来说这非常奇怪,因为 api 接口是不可能套 Captcha 的 目前无法知悉具体是为什么导致接口访问性变差

3gf8jv4dv commented 4 months ago

@HiTech0926

I tested it on my side and found that this may not be the case. Maybe your situation is just a coincidence? 🤔

And as @z0z0r4 said, modrinth.com will trigger Cloudflare verification, but api.modrinth.com will not.

LTCatt commented 4 months ago

如果你觉得是 Modrinth 的问题,可以向 support@modrinth.com 发邮件,并附上这个 issue 的链接…… 但这不是 PCL 导致的,所以我没法做点啥。

HiTech0926 commented 4 months ago

@HiTech0926

I tested it on my side and found that this may not be the case. Maybe your situation is just a coincidence? 🤔

And as @z0z0r4 said, will trigger Cloudflare verification, but will not.modrinth.com``api.modrinth.com

Cloudflare Captcha appears in China, but it does not appear when I open a VPN outside of mainland China. 在国内会出现Cloudflare Captcha,当我开启非大陆地区的VPN时,并不会出现Cloudflare Captcha。

3gf8jv4dv commented 4 months ago

Cloudflare Captcha appears in China, but it does not appear when I open a VPN outside of mainland China.
在国内会出现Cloudflare Captcha,当我开启非大陆地区的VPN时,并不会出现Cloudflare Captcha。

Not all IPs will trigger Cloudflare verification. In fact, even VPN/Proxy has a high probability of triggering.

HiTech0926 commented 4 months ago

测试国内访问应该是没问题的 QQ_1722015377659 但是在电信网络中却出现了许多失败,其他网络就只有2个失败 QQ_1722015410708 如下图,我所处地区山东青岛,测出来是失败,我这边也是失败 image image

难道……和电信还有关系?

JingHai-Lingyun commented 4 months ago

我给 Modrinth Support 发了一封询问邮件,看看他们那边会如何回复。 有关此连通性问题转 #4357 讨论,不在这里 off-topic 了。

z0z0r4 commented 4 months ago

modrinth.com 有 CF 盾,api.modrinth.com 没有

请不要,不要通过 modrinth.com 来检查 api.modrinth.com

@LTCatt 模组下载也会出问题,可以基本确定就是modrinth的锅 image 此时访问modrinth是验证 image 过完验证,刷新pcl2,又能加载出来了 image

请你试试看访问 api.modrinth.com 而不是 modrinth.com,看看有没有 CF 盾

也可以试着在无法加载出来的时候,试着执行 curl -v https://api.modrinth.com ,看看 headers 里面有没有 cf-mitigated: challenge,只有这种情况才是受到质询...

https://developers.cloudflare.com/waf/reference/cloudflare-challenges/

PhantomPixel-0418 commented 4 months ago

我前天去我老家,在我老家那边是正常的

PhantomPixel-0418 commented 4 months ago

image

PhantomPixel-0418 commented 4 months ago

可能是验证了,只不过响应时间超过10s,就当做连接超时了