Rain120 / qq-music-api

QQ 音乐API koa2实现
https://rain120.github.io/qq-music-api/
MIT License
727 stars 183 forks source link

好像彻底用不了了? #79

Open djkcyl opened 2 years ago

djkcyl commented 2 years ago

image

/soso/fcgi-bin/client_search_cp {
  opts: {
    params: {
      w: '周杰伦',
      n: 10,
      p: 1,
      catZhida: 1,
      remoteplace: 'txt.yqq.song',
      format: 'json',
      outCharset: 'utf-8',
      ct: 24,
      qqmusic_ver: 1298,
      t: 0,
      aggr: 1,
      cr: 1,
      lossless: 0,
      flag_qc: 0,
      platform: 'yqq.json'
    },
    g_tk: 1124214810,
    loginUin: '0',
    hostUin: 0,
    inCharset: 'utf8',
    outCharset: 'utf-8',
    notice: 0,
    platform: 'yqq.json',
    needNewCode: 0,
    headers: { referer: 'https://c.y.qq.com/', host: 'c.y.qq.com' }
  }
}
/soso/fcgi-bin/client_search_cp request error
error Error: Request failed with status code 404
    at createError (/root/qq-music-api/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/root/qq-music-api/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/root/qq-music-api/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  config: {
    url: 'https://c.y.qq.com/soso/fcgi-bin/client_search_cp',
    method: 'get',
    headers: {
      Accept: 'application/json, text/plain, */*',
      referer: 'https://c.y.qq.com/',
      host: 'c.y.qq.com',
      'User-Agent': 'axios/0.21.4'
    },
    params: {
      w: '周杰伦',
      n: 10,
      p: 1,
      catZhida: 1,
      remoteplace: 'txt.yqq.song',
      format: 'json',
      outCharset: 'utf-8',
      ct: 24,
      qqmusic_ver: 1298,
      t: 0,
      aggr: 1,
      cr: 1,
      lossless: 0,
      flag_qc: 0,
      platform: 'yqq.json'
    },
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 10000,
    withCredentials: true,
    adapter: [Function: httpAdapter],
    responseType: 'json;text/plain;charset=utf-8;',
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    validateStatus: [Function: validateStatus],
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    g_tk: 1124214810,
    loginUin: '0',
    hostUin: 0,
    inCharset: 'utf8',
    outCharset: 'utf-8',
    notice: 0,
    platform: 'yqq.json',
    needNewCode: 0,
    data: undefined
  },
  request: <ref *1> ClientRequest {
    _events: [Object: null prototype] {
      abort: [Function (anonymous)],
      aborted: [Function (anonymous)],
      connect: [Function (anonymous)],
      error: [Function (anonymous)],
      socket: [Function (anonymous)],
      timeout: [Function (anonymous)],
      prefinish: [Function: requestOnPrefinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    destroyed: false,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    maxRequestsOnConnectionReached: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: false,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: 0,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    _closed: false,
    socket: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: 'c.y.qq.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'c.y.qq.com',
      _readableState: [ReadableState],
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: [TLSWrap],
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [Circular *1],
      timeout: 10000,
      [Symbol(res)]: [TLSWrap],
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(async_id_symbol)]: 61,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: Timeout {
        _idleTimeout: 10000,
        _idlePrev: [TimersList],
        _idleNext: [TimersList],
        _idleStart: 3346,
        _onTimeout: [Function: bound ],
        _timerArgs: undefined,
        _repeat: null,
        _destroyed: false,
        [Symbol(refed)]: false,
        [Symbol(kHasPrimitive)]: false,
        [Symbol(asyncId)]: 70,
        [Symbol(triggerId)]: 65
      },
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kSetNoDelay)]: false,
      [Symbol(kSetKeepAlive)]: false,
      [Symbol(kSetKeepAliveInitialDelay)]: 0,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object]
    },
    _header: 'GET /soso/fcgi-bin/client_search_cp?w=%E5%91%A8%E6%9D%B0%E4%BC%A6&n=10&p=1&catZhida=1&remoteplace=txt.yqq.song&format=json&outCharset=utf-8&ct=24&qqmusic_ver=1298&t=0&aggr=1&cr=1&lossless=0&flag_qc=0&platform=yqq.json HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'referer: https://c.y.qq.com/\r\n' +
      'host: c.y.qq.com\r\n' +
      'User-Agent: axios/0.21.4\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 443,
      protocol: 'https:',
      options: [Object: null prototype],
      requests: [Object: null prototype] {},
      sockets: [Object: null prototype],
      freeSockets: [Object: null prototype] {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      scheduling: 'lifo',
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      maxCachedSessions: 100,
      _sessionCache: [Object],
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'GET',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    path: '/soso/fcgi-bin/client_search_cp?w=%E5%91%A8%E6%9D%B0%E4%BC%A6&n=10&p=1&catZhida=1&remoteplace=txt.yqq.song&format=json&outCharset=utf-8&ct=24&qqmusic_ver=1298&t=0&aggr=1&cr=1&lossless=0&flag_qc=0&platform=yqq.json',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      socket: [TLSSocket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      rawHeaders: [Array],
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 404,
      statusMessage: 'Not Found',
      client: [TLSSocket],
      _consuming: false,
      _dumped: false,
      req: [Circular *1],
      responseUrl: 'https://c.y.qq.com/soso/fcgi-bin/client_search_cp?w=%E5%91%A8%E6%9D%B0%E4%BC%A6&n=10&p=1&catZhida=1&remoteplace=txt.yqq.song&format=json&outCharset=utf-8&ct=24&qqmusic_ver=1298&t=0&aggr=1&cr=1&lossless=0&flag_qc=0&platform=yqq.json',
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(kHeaders)]: [Object],
      [Symbol(kHeadersCount)]: 12,
      [Symbol(kTrailers)]: null,
      [Symbol(kTrailersCount)]: 0
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'c.y.qq.com',
    protocol: 'https:',
    _redirectable: Writable {
      _writableState: [WritableState],
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 0,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *1],
      _currentUrl: 'https://c.y.qq.com/soso/fcgi-bin/client_search_cp?w=%E5%91%A8%E6%9D%B0%E4%BC%A6&n=10&p=1&catZhida=1&remoteplace=txt.yqq.song&format=json&outCharset=utf-8&ct=24&qqmusic_ver=1298&t=0&aggr=1&cr=1&lossless=0&flag_qc=0&platform=yqq.json',
      _timeout: null,
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      referer: [Array],
      host: [Array],
      'user-agent': [Array]
    },
    [Symbol(kUniqueHeaders)]: null
  },
  response: {
    status: 404,
    statusText: 'Not Found',
    headers: {
      server: 'nginx',
      date: 'Fri, 29 Jul 2022 11:37:47 GMT',
      'content-type': 'text/html',
      'content-length': '0',
      connection: 'close',
      'cache-control': 'no-cache'
    },
    config: {
      url: 'https://c.y.qq.com/soso/fcgi-bin/client_search_cp',
      method: 'get',
      headers: [Object],
      params: [Object],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 10000,
      withCredentials: true,
      adapter: [Function: httpAdapter],
      responseType: 'json;text/plain;charset=utf-8;',
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      validateStatus: [Function: validateStatus],
      transitional: [Object],
      g_tk: 1124214810,
      loginUin: '0',
      hostUin: 0,
      inCharset: 'utf8',
      outCharset: 'utf-8',
      notice: 0,
      platform: 'yqq.json',
      needNewCode: 0,
      data: undefined
    },
    request: <ref *1> ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: false,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: 0,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: [TLSSocket],
      _header: 'GET /soso/fcgi-bin/client_search_cp?w=%E5%91%A8%E6%9D%B0%E4%BC%A6&n=10&p=1&catZhida=1&remoteplace=txt.yqq.song&format=json&outCharset=utf-8&ct=24&qqmusic_ver=1298&t=0&aggr=1&cr=1&lossless=0&flag_qc=0&platform=yqq.json HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'referer: https://c.y.qq.com/\r\n' +
        'host: c.y.qq.com\r\n' +
        'User-Agent: axios/0.21.4\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'GET',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/soso/fcgi-bin/client_search_cp?w=%E5%91%A8%E6%9D%B0%E4%BC%A6&n=10&p=1&catZhida=1&remoteplace=txt.yqq.song&format=json&outCharset=utf-8&ct=24&qqmusic_ver=1298&t=0&aggr=1&cr=1&lossless=0&flag_qc=0&platform=yqq.json',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'c.y.qq.com',
      protocol: 'https:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(kUniqueHeaders)]: null
    },
    data: ''
  },
  isAxiosError: true,
  toJSON: [Function: toJSON]
}

  AssertionError [ERR_ASSERTION]: status code must be a number
      at Object.set status [as status] (/root/qq-music-api/node_modules/koa/lib/response.js:86:5)
      at Object.assign (/root/qq-music-api/node_modules/delegates/index.js:92:31)
      at Function.assign (<anonymous>)
      at /root/qq-music-api/routers/context/getSearchByKey.js:22:10
      at Generator.next (<anonymous>)
      at asyncGeneratorStep (/root/qq-music-api/routers/context/getSearchByKey.js:1:103)
      at _next (/root/qq-music-api/routers/context/getSearchByKey.js:3:194)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
Rain120 commented 2 years ago

@djkcyl Thx for your report, more info issue

VCE-K commented 1 year ago

大佬,我也是这个,搜索接口不能用了,会出现 AssertionError [ERR_ASSERTION]: status code must be a number at Object.set status [as status] (/root/qq-music-api/node_modules/koa/lib/response.js:86:5) at Object.assign (/root/qq-music-api/node_modules/delegates/index.js:92:31) at Function.assign () at /root/qq-music-api/routers/context/getSearchByKey.js:22:10 at Generator.next () at asyncGeneratorStep (/root/qq-music-api/routers/context/getSearchByKey.js:1:103) at _next (/root/qq-music-api/routers/context/getSearchByKey.js:2:194) at processTicksAndRejections (node:internal/process/task_queues:96:5)