mteamwhy / mt-web-pre

28 stars 0 forks source link

API无法使用 #166

Closed mikoto-kamijou closed 6 months ago

mikoto-kamijou commented 6 months ago

每次都redirect到www.google.com 主站kp.m-team.cc也不行

$ curl -vv -L -X POST -H 'Accept:*/*' -H 'Content-Type:application/json' -H 'x-api-key:xxxxxx' -d '{"sortField":"CREATED_DATE","sortDirection":"DESC","discount":"FREE"}' 'http://test2.m-team.cc/api/api/torrent/search'
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying [2606:4700:20::ac43:4908]:80...
* Connected to test2.m-team.cc (2606:4700:20::ac43:4908) port 80 (#0)
> POST /api/api/torrent/search HTTP/1.1
> Host: test2.m-team.cc
> User-Agent: curl/7.88.1
> Accept:*/*
> Content-Type:application/json
> x-api-key:xxxx
> Content-Length: 69
> 
< HTTP/1.1 301 Moved Permanently
< Date: Mon, 01 Apr 2024 07:53:16 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: max-age=3600
< Expires: Mon, 01 Apr 2024 08:53:16 GMT
* Please rewind output before next send
< Location: https://test2.m-team.cc/api/api/torrent/search
< Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=FFxi3oB39W6WfT4qckJFQ1%2B19oUgb1h%2FaTXWQ5yT89LOYfPfTlPgbcfEO39MyV6bUgUM3TPu9dgqEMGOc55GmXglwVKCrDp4z5zA9APmbiCZqFl0mdZWWu%2FuYPWKfphxEdCRubMyPxjhQF%2FlHQ%3D%3D"}],"group":"cf-nel","max_age":604800}
< NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< X-Content-Type-Options: nosniff
< Server: cloudflare
< CF-RAY: 86d70128df719e32-SIN
< alt-svc: h3=":443"; ma=86400
< 
* Ignoring the response-body
* Connection #0 to host test2.m-team.cc left intact
* Clear auth, redirects to port from 80 to 443
* Issue another request to this URL: 'https://test2.m-team.cc/api/api/torrent/search'
* Switch from POST to GET
*   Trying [2606:4700:20::681a:c32]:443...
* Connected to test2.m-team.cc (2606:4700:20::681a:c32) port 443 (#1)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=m-team.cc
*  start date: Mar 29 06:42:12 2024 GMT
*  expire date: Jun 27 07:40:57 2024 GMT
*  subjectAltName: host "test2.m-team.cc" matched cert's "*.m-team.cc"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1P5
*  SSL certificate verify ok.
* using HTTP/2
* h2h3 [:method: POST]
* h2h3 [:path: /api/api/torrent/search]
* h2h3 [:scheme: https]
* h2h3 [:authority: test2.m-team.cc]
* h2h3 [user-agent: curl/7.88.1]
* h2h3 [accept: */*]
* h2h3 [content-type: application/json]
* h2h3 [x-api-key: xxxx
* Using Stream ID: 1 (easy handle 0x557069516c80)
> POST /api/api/torrent/search HTTP/2
> Host: test2.m-team.cc
> user-agent: curl/7.88.1
> accept:*/*
> content-type:application/json
> x-api-key:xxx
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/2 302 
< date: Mon, 01 Apr 2024 07:53:17 GMT
< content-type: text/html
< location: https://www.google.com/api/api/torrent/search
< strict-transport-security: max-age=15552000; includeSubDomains; preload
< cf-cache-status: DYNAMIC
< report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=kT4JvbJExfmxWl9xuAekDyS8FO74TXclH5NrUJauiSIXXzHTYzNbyQU6A4DTlsaDCGzC5yPXngIgjawGZR1jHOX6MSevEgkRbvuegX5LoJXRWBqwHiCxCZprtFZd%2FrOD1Cus%2BkrkLYn1w2NNfw%3D%3D"}],"group":"cf-nel","max_age":604800}
< nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< x-content-type-options: nosniff
< server: cloudflare
< cf-ray: 86d701293f079f91-SIN
< alt-svc: h3=":443"; ma=86400
< 
* Ignoring the response-body
* Connection #1 to host test2.m-team.cc left intact
* Issue another request to this URL: 'https://www.google.com/api/api/torrent/search'
*   Trying [2404:6800:4003:c02::63]:443...
* Connected to www.google.com (2404:6800:4003:c02::63) port 443 (#2)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=www.google.com
*  start date: Mar  4 07:19:07 2024 GMT
*  expire date: May 27 07:19:06 2024 GMT
*  subjectAltName: host "www.google.com" matched cert's "www.google.com"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1C3
*  SSL certificate verify ok.
* using HTTP/2
* h2h3 [:method: POST]
* h2h3 [:path: /api/api/torrent/search]
* h2h3 [:scheme: https]
* h2h3 [:authority: www.google.com]
* h2h3 [user-agent: curl/7.88.1]
* h2h3 [accept: */*]
* h2h3 [content-type: application/json]
* h2h3 [x-api-key: xxxx
* Using Stream ID: 1 (easy handle 0x557069516c80)
> POST /api/api/torrent/search HTTP/2
> Host: www.google.com
> user-agent: curl/7.88.1
> accept:*/*
> content-type:application/json
> x-api-key:xxx
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/2 404 
< content-type: text/html; charset=UTF-8
< referrer-policy: no-referrer
< content-length: 1583
< date: Mon, 01 Apr 2024 07:53:17 GMT
< alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
< 
<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>The requested URL <code>/api/api/torrent/search</code> was not found on this server.  <ins>That’s all we know.</ins>
* Connection #2 to host www.google.com left intact
jianglin8-hub commented 6 months ago

/api/api/

兄弟你认真的?

mikoto-kamijou commented 6 months ago

文档里的curl命令中用的URL是/api/api/ image

mikoto-kamijou commented 6 months ago

把URL改成 http://test2.m-team.cc/api/torrent/search 也是一样不行,会redirect到www.google.com

$ curl -vv -L -X POST -H 'Accept:*/*' -H 'Content-Type:application/json' -H 'x-api-key:xxxxxx' -d '{"sortField":"CREATED_DATE","sortDirection":"DESC","discount":"FREE"}' 'http://test2.m-team.cc/api/torrent/search'
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying [2606:4700:20::681a:d32]:80...
* Connected to test2.m-team.cc (2606:4700:20::681a:d32) port 80 (#0)
> POST /api/torrent/search HTTP/1.1
> Host: test2.m-team.cc
> User-Agent: curl/7.88.1
> Accept:*/*
> Content-Type:application/json
> x-api-key:xxx
> Content-Length: 69
> 
< HTTP/1.1 301 Moved Permanently
< Date: Mon, 01 Apr 2024 13:18:46 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: max-age=3600
< Expires: Mon, 01 Apr 2024 14:18:46 GMT
* Please rewind output before next send
< Location: https://test2.m-team.cc/api/torrent/search
< Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=xB3kxSvV%2FDqMVQnepCx1N3jGUjgfzzhofcFvr%2BVnwPSBiE4zXDZMCbZKeGYwRvqJstRlXd%2FeplLo5s04%2FsgomjnJ5npfnJD9w3JSABM9XaCRLzyCrfcZqfuUHL%2FYrzBhbYOAgQnOQyp5lUO1qg%3D%3D"}],"group":"cf-nel","max_age":604800}
< NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< X-Content-Type-Options: nosniff
< Server: cloudflare
< CF-RAY: 86d8ddf45def9e2e-SIN
< alt-svc: h3=":443"; ma=86400
< 
* Ignoring the response-body
* Connection #0 to host test2.m-team.cc left intact
* Clear auth, redirects to port from 80 to 443
* Issue another request to this URL: 'https://test2.m-team.cc/api/torrent/search'
* Switch from POST to GET
*   Trying [2606:4700:20::681a:d32]:443...
* Connected to test2.m-team.cc (2606:4700:20::681a:d32) port 443 (#1)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted http/1.1
* Server certificate:
*  subject: CN=m-team.cc
*  start date: Mar 29 06:42:12 2024 GMT
*  expire date: Jun 27 07:40:57 2024 GMT
*  subjectAltName: host "test2.m-team.cc" matched cert's "*.m-team.cc"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1P5
*  SSL certificate verify ok.
* using HTTP/1.1
> POST /api/torrent/search HTTP/1.1
> Host: test2.m-team.cc
> User-Agent: curl/7.88.1
> Accept:*/*
> Content-Type:application/json
> x-api-key:xxx
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/1.1 302 Found
< Date: Mon, 01 Apr 2024 13:18:47 GMT
< Content-Type: text/html
< Transfer-Encoding: chunked
< Connection: close
< Location: https://www.google.com/api/torrent/search
< Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
< CF-Cache-Status: DYNAMIC
< Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=9RDrzerGg0gFn21XblTzD5IMW3k7AHaAPXMRje5TZDspLd3MBbfF%2BPMUfFYM3HaeeZR7zF5TP9j2dqrn5KjO6sCvLRP%2FD68hpdG49dY7TI3rB29r%2BgL3bUwjDo%2BIWWFEilMHuClBWAGKDHbPxQ%3D%3D"}],"group":"cf-nel","max_age":604800}
< NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< X-Content-Type-Options: nosniff
< Server: cloudflare
< CF-RAY: 86d8ddf7a8a64499-SIN
< alt-svc: h3=":443"; ma=86400
< 
* Closing connection 1
* TLSv1.3 (OUT), TLS alert, close notify (256):
* Issue another request to this URL: 'https://www.google.com/api/torrent/search'
*   Trying [2404:6800:4003:c11::67]:443...
* Connected to www.google.com (2404:6800:4003:c11::67) port 443 (#2)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=www.google.com
*  start date: Mar  4 07:19:07 2024 GMT
*  expire date: May 27 07:19:06 2024 GMT
*  subjectAltName: host "www.google.com" matched cert's "www.google.com"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1C3
*  SSL certificate verify ok.
* using HTTP/2
* h2h3 [:method: POST]
* h2h3 [:path: /api/torrent/search]
* h2h3 [:scheme: https]
* h2h3 [:authority: www.google.com]
* h2h3 [user-agent: curl/7.88.1]
* h2h3 [accept: */*]
* h2h3 [content-type: application/json]
* h2h3 [x-api-key: xxx]
* Using Stream ID: 1 (easy handle 0x55fb4c997c80)
> POST /api/torrent/search HTTP/2
> Host: www.google.com
> user-agent: curl/7.88.1
> accept:*/*
> content-type:application/json
> x-api-key:xxx
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/2 404 
< content-type: text/html; charset=UTF-8
< referrer-policy: no-referrer
< content-length: 1579
< date: Mon, 01 Apr 2024 13:18:47 GMT
< alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
< 
<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>The requested URL <code>/api/torrent/search</code> was not found on this server.  <ins>That’s all we know.</ins>
* Connection #2 to host www.google.com left intact
jianglin8-hub commented 6 months ago

把URL改成 http://test2.m-team.cc/api/torrent/search 也是一样不行,会redirect到www.google.com

$ curl -vv -L -X POST -H 'Accept:*/*' -H 'Content-Type:application/json' -H 'x-api-key:xxxxxx' -d '{"sortField":"CREATED_DATE","sortDirection":"DESC","discount":"FREE"}' 'http://test2.m-team.cc/api/torrent/search'
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying [2606:4700:20::681a:d32]:80...
* Connected to test2.m-team.cc (2606:4700:20::681a:d32) port 80 (#0)
> POST /api/torrent/search HTTP/1.1
> Host: test2.m-team.cc
> User-Agent: curl/7.88.1
> Accept:*/*
> Content-Type:application/json
> x-api-key:xxx
> Content-Length: 69
> 
< HTTP/1.1 301 Moved Permanently
< Date: Mon, 01 Apr 2024 13:18:46 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: max-age=3600
< Expires: Mon, 01 Apr 2024 14:18:46 GMT
* Please rewind output before next send
< Location: https://test2.m-team.cc/api/torrent/search
< Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=xB3kxSvV%2FDqMVQnepCx1N3jGUjgfzzhofcFvr%2BVnwPSBiE4zXDZMCbZKeGYwRvqJstRlXd%2FeplLo5s04%2FsgomjnJ5npfnJD9w3JSABM9XaCRLzyCrfcZqfuUHL%2FYrzBhbYOAgQnOQyp5lUO1qg%3D%3D"}],"group":"cf-nel","max_age":604800}
< NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< X-Content-Type-Options: nosniff
< Server: cloudflare
< CF-RAY: 86d8ddf45def9e2e-SIN
< alt-svc: h3=":443"; ma=86400
< 
* Ignoring the response-body
* Connection #0 to host test2.m-team.cc left intact
* Clear auth, redirects to port from 80 to 443
* Issue another request to this URL: 'https://test2.m-team.cc/api/torrent/search'
* Switch from POST to GET
*   Trying [2606:4700:20::681a:d32]:443...
* Connected to test2.m-team.cc (2606:4700:20::681a:d32) port 443 (#1)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted http/1.1
* Server certificate:
*  subject: CN=m-team.cc
*  start date: Mar 29 06:42:12 2024 GMT
*  expire date: Jun 27 07:40:57 2024 GMT
*  subjectAltName: host "test2.m-team.cc" matched cert's "*.m-team.cc"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1P5
*  SSL certificate verify ok.
* using HTTP/1.1
> POST /api/torrent/search HTTP/1.1
> Host: test2.m-team.cc
> User-Agent: curl/7.88.1
> Accept:*/*
> Content-Type:application/json
> x-api-key:xxx
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/1.1 302 Found
< Date: Mon, 01 Apr 2024 13:18:47 GMT
< Content-Type: text/html
< Transfer-Encoding: chunked
< Connection: close
< Location: https://www.google.com/api/torrent/search
< Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
< CF-Cache-Status: DYNAMIC
< Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=9RDrzerGg0gFn21XblTzD5IMW3k7AHaAPXMRje5TZDspLd3MBbfF%2BPMUfFYM3HaeeZR7zF5TP9j2dqrn5KjO6sCvLRP%2FD68hpdG49dY7TI3rB29r%2BgL3bUwjDo%2BIWWFEilMHuClBWAGKDHbPxQ%3D%3D"}],"group":"cf-nel","max_age":604800}
< NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< X-Content-Type-Options: nosniff
< Server: cloudflare
< CF-RAY: 86d8ddf7a8a64499-SIN
< alt-svc: h3=":443"; ma=86400
< 
* Closing connection 1
* TLSv1.3 (OUT), TLS alert, close notify (256):
* Issue another request to this URL: 'https://www.google.com/api/torrent/search'
*   Trying [2404:6800:4003:c11::67]:443...
* Connected to www.google.com (2404:6800:4003:c11::67) port 443 (#2)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=www.google.com
*  start date: Mar  4 07:19:07 2024 GMT
*  expire date: May 27 07:19:06 2024 GMT
*  subjectAltName: host "www.google.com" matched cert's "www.google.com"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1C3
*  SSL certificate verify ok.
* using HTTP/2
* h2h3 [:method: POST]
* h2h3 [:path: /api/torrent/search]
* h2h3 [:scheme: https]
* h2h3 [:authority: www.google.com]
* h2h3 [user-agent: curl/7.88.1]
* h2h3 [accept: */*]
* h2h3 [content-type: application/json]
* h2h3 [x-api-key: xxx]
* Using Stream ID: 1 (easy handle 0x55fb4c997c80)
> POST /api/torrent/search HTTP/2
> Host: www.google.com
> user-agent: curl/7.88.1
> accept:*/*
> content-type:application/json
> x-api-key:xxx
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/2 404 
< content-type: text/html; charset=UTF-8
< referrer-policy: no-referrer
< content-length: 1579
< date: Mon, 01 Apr 2024 13:18:47 GMT
< alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
< 
<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>The requested URL <code>/api/torrent/search</code> was not found on this server.  <ins>That’s all we know.</ins>
* Connection #2 to host www.google.com left intact

换个UA

mikoto-kamijou commented 6 months ago

把URL改成 http://test2.m-team.cc/api/torrent/search 也是一样不行,会redirect到www.google.com

$ curl -vv -L -X POST -H 'Accept:*/*' -H 'Content-Type:application/json' -H 'x-api-key:xxxxxx' -d '{"sortField":"CREATED_DATE","sortDirection":"DESC","discount":"FREE"}' 'http://test2.m-team.cc/api/torrent/search'
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying [2606:4700:20::681a:d32]:80...
* Connected to test2.m-team.cc (2606:4700:20::681a:d32) port 80 (#0)
> POST /api/torrent/search HTTP/1.1
> Host: test2.m-team.cc
> User-Agent: curl/7.88.1
> Accept:*/*
> Content-Type:application/json
> x-api-key:xxx
> Content-Length: 69
> 
< HTTP/1.1 301 Moved Permanently
< Date: Mon, 01 Apr 2024 13:18:46 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: max-age=3600
< Expires: Mon, 01 Apr 2024 14:18:46 GMT
* Please rewind output before next send
< Location: https://test2.m-team.cc/api/torrent/search
< Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=xB3kxSvV%2FDqMVQnepCx1N3jGUjgfzzhofcFvr%2BVnwPSBiE4zXDZMCbZKeGYwRvqJstRlXd%2FeplLo5s04%2FsgomjnJ5npfnJD9w3JSABM9XaCRLzyCrfcZqfuUHL%2FYrzBhbYOAgQnOQyp5lUO1qg%3D%3D"}],"group":"cf-nel","max_age":604800}
< NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< X-Content-Type-Options: nosniff
< Server: cloudflare
< CF-RAY: 86d8ddf45def9e2e-SIN
< alt-svc: h3=":443"; ma=86400
< 
* Ignoring the response-body
* Connection #0 to host test2.m-team.cc left intact
* Clear auth, redirects to port from 80 to 443
* Issue another request to this URL: 'https://test2.m-team.cc/api/torrent/search'
* Switch from POST to GET
*   Trying [2606:4700:20::681a:d32]:443...
* Connected to test2.m-team.cc (2606:4700:20::681a:d32) port 443 (#1)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted http/1.1
* Server certificate:
*  subject: CN=m-team.cc
*  start date: Mar 29 06:42:12 2024 GMT
*  expire date: Jun 27 07:40:57 2024 GMT
*  subjectAltName: host "test2.m-team.cc" matched cert's "*.m-team.cc"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1P5
*  SSL certificate verify ok.
* using HTTP/1.1
> POST /api/torrent/search HTTP/1.1
> Host: test2.m-team.cc
> User-Agent: curl/7.88.1
> Accept:*/*
> Content-Type:application/json
> x-api-key:xxx
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/1.1 302 Found
< Date: Mon, 01 Apr 2024 13:18:47 GMT
< Content-Type: text/html
< Transfer-Encoding: chunked
< Connection: close
< Location: https://www.google.com/api/torrent/search
< Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
< CF-Cache-Status: DYNAMIC
< Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=9RDrzerGg0gFn21XblTzD5IMW3k7AHaAPXMRje5TZDspLd3MBbfF%2BPMUfFYM3HaeeZR7zF5TP9j2dqrn5KjO6sCvLRP%2FD68hpdG49dY7TI3rB29r%2BgL3bUwjDo%2BIWWFEilMHuClBWAGKDHbPxQ%3D%3D"}],"group":"cf-nel","max_age":604800}
< NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< X-Content-Type-Options: nosniff
< Server: cloudflare
< CF-RAY: 86d8ddf7a8a64499-SIN
< alt-svc: h3=":443"; ma=86400
< 
* Closing connection 1
* TLSv1.3 (OUT), TLS alert, close notify (256):
* Issue another request to this URL: 'https://www.google.com/api/torrent/search'
*   Trying [2404:6800:4003:c11::67]:443...
* Connected to www.google.com (2404:6800:4003:c11::67) port 443 (#2)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=www.google.com
*  start date: Mar  4 07:19:07 2024 GMT
*  expire date: May 27 07:19:06 2024 GMT
*  subjectAltName: host "www.google.com" matched cert's "www.google.com"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1C3
*  SSL certificate verify ok.
* using HTTP/2
* h2h3 [:method: POST]
* h2h3 [:path: /api/torrent/search]
* h2h3 [:scheme: https]
* h2h3 [:authority: www.google.com]
* h2h3 [user-agent: curl/7.88.1]
* h2h3 [accept: */*]
* h2h3 [content-type: application/json]
* h2h3 [x-api-key: xxx]
* Using Stream ID: 1 (easy handle 0x55fb4c997c80)
> POST /api/torrent/search HTTP/2
> Host: www.google.com
> user-agent: curl/7.88.1
> accept:*/*
> content-type:application/json
> x-api-key:xxx
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/2 404 
< content-type: text/html; charset=UTF-8
< referrer-policy: no-referrer
< content-length: 1579
< date: Mon, 01 Apr 2024 13:18:47 GMT
< alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
< 
<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>The requested URL <code>/api/torrent/search</code> was not found on this server.  <ins>That’s all we know.</ins>
* Connection #2 to host www.google.com left intact

换个UA

可以了,多谢