subconverter icon indicating copy to clipboard operation
subconverter copied to clipboard

[BUG] 订阅配置request返回500,subconverter显示"The following link doesn't contain any valid node info",本地curl可以正常拿到文件

Open coso321 opened this issue 2 years ago • 6 comments

确认版本最新

  • [X] 我已经确认在最新Action编译的版本中复现

检索issue

  • [X] 我已经确认之前没有issue涉及此BUG

subconverter版本

0.7.2

转换过程

Clash订阅转Clash

转换设置

http://localhost:25500/sub?target=clash&new_name=true&url=https%3A%2F%2Fservice-6tjm1nze.trafficmanager.net%2Fsub%3Ftarget%3Dclash%26url%3Dhttps%3A%2F%2Frelaysub.trafficmanager.net%2Flink%xxxxxxxxxxxx%3Fsub%3D1%26extend%3D1&insert=false&filename=test.ini&emoji=true&list=false&tfo=false&scv=false&fdn=false&sort=false&udp=true

复现步骤

连接没有问题,但是request返回了500,本地curl能够正常拿到订阅文件。

本地curl-7.74正常:

> GET /sub?target=clash&url=https://relaysub.trafficmanager.net/link/xxxxxxxxxx?sub=1&extend=1 HTTP/2
> Host: service-6tjm1nze.trafficmanager.net
> user-agent: curl/7.74.0
> accept: */*
> 
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [130 bytes data]
* Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
} [5 bytes data]
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0< HTTP/2 200 
< access-control-allow-origin: *
< cache-control: no-cache
< content-type: text/plain;charset=utf-8
< date: Sun, 29 Jan 2023 17:00:06 GMT
< profile-update-interval: 24
< server: nginx
< subscription-userinfo: upload=11516954466; download=279527380437; total=1300135673856; expire=1699908934
< vary: Accept-Encoding
< x-cache: BYPASS
< x-cache: MISS
< 
{ [5 bytes data]
100  519k    0  519k    0     0   116k      0 --:--:--  0:00:04 --:--:--  116k
* Connection #0 to host service-6tjm1nze.trafficmanager.net left intact

强制http1.1也正常

> GET /sub?target=clash&url=https://relaysub.trafficmanager.net/link/xxxxxxxxx?sub=1&extend=1 HTTP/1.1
> Host: service-6tjm1nze.trafficmanager.net
> User-Agent: curl/7.74.0
> Accept: */*
> 
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [130 bytes data]
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Cache-Control: no-cache
< Content-Type: text/plain;charset=utf-8
< Date: Sun, 29 Jan 2023 17:14:18 GMT
< Profile-Update-Interval: 24
< Server: nginx
< Subscription-Userinfo: upload=11518300414; download=279544330529; total=1300135673856; expire=1699908934
< Vary: Accept-Encoding
< X-Cache: BYPASS
< X-Cache: MISS
< Transfer-Encoding: chunked
< 
{ [800 bytes data]
100  519k    0  519k    0     0   155k      0 --:--:--  0:00:03 --:--:--  155k
* Connection #0 to host service-6tjm1nze.trafficmanager.net left intact

期望结果

正常拿到订阅文件

实际结果

订阅失败,request服务器返回500

错误信息

2023/01/29 Sun 23:02:49.838358 [8524 135132663438136][INFO] Fetching node data from url 'https://service-6tjm1nze.trafficmanager.net/sub?target=clash&url=https://relaysub.trafficmanager.net/link/xxxxxxxxxx?sub=1&extend=1'.
2023/01/29 Sun 23:02:49.839867 [8524 135132663438136][VERB] Received Link.
2023/01/29 Sun 23:02:49.839906 [8524 135132663438136][VERB] Downloading subscription data...
2023/01/29 Sun 23:02:49.846990 [8524 135132663438136][VERB] CACHE NOT EXIST: 'https://service-6tjm1nze.trafficmanager.net/sub?target=clash&url=https://relaysub.trafficmanager.net/link/xxxxxxxxx?sub=1&extend=1', creating new cache.
*   Trying 20.239.70.244:443...
* Connected to service-6tjm1nze.trafficmanager.net (20.239.70.244) port 443 (#0)
* mbedTLS: Connecting to service-6tjm1nze.trafficmanager.net:443
* mbedTLS: Set min SSL version to TLS 1.0
* mbedTLS: Handshake complete, cipher is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256
* Dumping cert info: * cert. version     : 3
* serial number     : 43:46:EF:92:13:0C:11:A2:5C:F7:7C:58:C0:33:EE:E6
* issuer name       : C=US, O=Root Networks, LLC, CN=Root CA - G3
* subject name      : CN=service-6tjm1nze.trafficmanager.net
* issued  on        : 2022-10-27 12:35:44
* expires on        : 2023-10-27 12:35:43
* signed using      : RSA with SHA-256
* RSA key size      : 2048 bits
* basic constraints : CA=false
* subject alt name  : service-6tjm1nze.trafficmanager.net
* key usage         : Digital Signature, Key Encipherment
* ext key usage     : TLS Web Server Authentication, TLS Web Client Authentication

* SSL connected
> GET /sub?target=clash&url=https://relaysub.trafficmanager.net/link/xxxxxxxx?sub=1&extend=1 HTTP/1.1
Host: service-6tjm1nze.trafficmanager.net
Accept: */*
Content-Type: application/json;charset='utf-8'
X-Client-IP: 127.0.0.1
Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7
Sec-Fetch-Dest: document
Sec-Fetch-User: ?1
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
User-Agent: Mozilla/5.0 (X11; CrOS x86_64 15236.66.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Upgrade-Insecure-Requests: 1
DNT: 1
sec-ch-ua-platform: "Chrome OS"
sec-ch-ua-mobile: ?0
sec-ch-ua: "Not_A Brand";v="99", "Google Chrome";v="109", "Chromium";v="109"
Connection: keep-alive
SubConverter-Request: 1
SubConverter-Version: v0.7.2

* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Content-Length: 116
< Content-Type: text/html
< Date: Sun, 29 Jan 2023 15:02:47 GMT
< Server: nginx
< X-Cache: BYPASS
< 
* Connection #0 to host service-6tjm1nze.trafficmanager.net left intact
2023/01/29 Sun 23:02:50.607400 [8524 135132663438136][VERB] Fetch failed. No local cache available.
2023/01/29 Sun 23:02:50.607622 [8524 135132663438136][VERB] Cannot download subscription data.
2023/01/29 Sun 23:02:50.607853 [8524 135132663438136][WARN] The following link doesn't contain any valid node info: https://service-6tjm1nze.trafficmanager.net/sub?target=clash&url=https://relaysub.trafficmanager.net/link/xxxxxxxxx?sub=1&extend=1

coso321 avatar Jan 29 '23 17:01 coso321

某些时候,有些订阅提供者会根据请求头屏蔽部分请求,subconvertor带有SubConverter-RequestSubConverter-Version的请求头,而且目前似乎没有提供更改请求头的方法,目前好像无解。 或者你可以自己修改源代码然后编译。

sandwichBob avatar Feb 19 '23 15:02 sandwichBob

某些时候,有些订阅提供者会根据请求头屏蔽部分请求,subconvertor带有SubConverter-RequestSubConverter-Version的请求头,而且目前似乎没有提供更改请求头的方法,目前好像无解。 或者你可以自己修改源代码然后编译。

确实是请求头的问题,我Fork了项目把请求头代码注释掉了,然后用Actions构建了Mac和Win的程序(Linux的构建失败): https://github.com/jing332/subconverter/releases

jing332 avatar Mar 02 '23 02:03 jing332

~~我也改了一波用Action编译了,包含Linux的,自己用似乎是可以了。~~
用修改后版本现在也还是出现一样的问题了

Oosl avatar Apr 19 '23 09:04 Oosl

我也遇到同样的问题,subconverter显示"The following link doesn't contain any valid node info",本地浏览器可以正常拿到文件,希望能解决这个问题。

bigoovip avatar Nov 14 '23 07:11 bigoovip

遇到了同样的问题,某些服务商过滤了带有SubConverter-Request header的请求,希望能够提供一个配置让subconverter获取订阅的时候不带上这个header

ChaojuWang avatar Jun 13 '24 17:06 ChaojuWang

遇到了同样的问题,某些服务商过滤了带有SubConverter-Request header的请求,希望能够提供一个配置让subconverter获取订阅的时候不带上这个header 楼上有修改版,或者可以使用这个https://github.com/hinak0/ClashConfigConverter

hinak0 avatar Jun 14 '24 11:06 hinak0