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

添加了 Cookie 下载个人喜欢返回 502 #49

Closed
lyc8503 opened this issue Oct 15, 2022 · 5 comments
Closed

添加了 Cookie 下载个人喜欢返回 502 #49

lyc8503 opened this issue Oct 15, 2022 · 5 comments

Comments

@lyc8503
Copy link

lyc8503 commented Oct 15, 2022

按照文档要求使用 Chrome 插件导出了 Cookie 并保存为 yun.cookie.txt
内容类似下面这样.

[
{
    "domain": ".163.com",
    "expirationDate": 1697034245.287346,
    "hostOnly": false,
    "httpOnly": false,
    "name": "_ntes_nnid",
    "path": "/",
    "sameSite": "unspecified",
    "secure": false,
    "session": false,
    "storeId": "0",
    "value": "xxx",
    "id": 1
},......
]

程序输出

当前参数
concurrency:    5
format:         :name/:singer - :songName.:ext
retry-timeout:  3 (分钟)
retry-times:    3 (次)
quality:        320
skip:           true
progress:       true
cover:          false

[cookie] 使用 cookie 文件: /home/xxx/yun.cookie.txt
{
  status: 502,
  body: {
    code: 502,
    msg: Error: aborted
        at connResetException (node:internal/errors:692:14)
        at TLSSocket.socketCloseListener (node:_http_client:414:19)
        at TLSSocket.emit (node:events:539:35)
        at node:net:709:12
        at TCP.done (node:_tls_wrap:582:7) {
      code: 'ECONNRESET',
      config: [Object],
      request: [ClientRequest],
      response: undefined,
      isAxiosError: true,
      toJSON: [Function: toJSON]
    }
  },
  cookie: []
}
@magicdawn
Copy link
Owner

magicdawn commented Oct 16, 2022

image

正确格式是分号分隔字符串, 从 EditThisCookie 导出后原样粘贴即可, // 注释本程序会自动剔除

@lyc8503
Copy link
Author

lyc8503 commented Oct 16, 2022

可是我从 EditThisCookie 导出的格式好像原本不太一样...

我导出的格式如下:

[
{
    "domain": ".weibo.com",
    "expirationDate": 1665909683.986669,
    "hostOnly": false,
    "httpOnly": true,
    "name": "PC_TOKEN",
    "path": "/",
    "sameSite": "unspecified",
    "secure": true,
    "session": false,
    "storeId": "0",
    "value": "xxx",
    "id": 1
},
{
    "domain": ".weibo.com",
    "expirationDate": 1697443887.810198,
    "hostOnly": false,
    "httpOnly": true,
    "name": "SUB",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": true,
    "session": false,
    "storeId": "0",
    "value": "xxx",
    "id": 2
},
{
    "domain": ".weibo.com",
    "expirationDate": 1697443887.810241,
    "hostOnly": false,
    "httpOnly": false,
    "name": "SUBP",
    "path": "/",
    "sameSite": "unspecified",
    "secure": false,
    "session": false,
    "storeId": "0",
    "value": "xxx",
    "id": 3
},
{
    "domain": "weibo.com",
    "expirationDate": 1665994287.94975,
    "hostOnly": true,
    "httpOnly": true,
    "name": "WBPSESS",
    "path": "/",
    "sameSite": "unspecified",
    "secure": true,
    "session": false,
    "storeId": "0",
    "value": "xxx",
    "id": 4
},
{
    "domain": "weibo.com",
    "hostOnly": true,
    "httpOnly": false,
    "name": "XSRF-TOKEN",
    "path": "/",
    "sameSite": "unspecified",
    "secure": true,
    "session": true,
    "storeId": "0",
    "value": "xxx",
    "id": 5
}
]

我使用的 EditThisCookie 版本, 是目前 Chrome 应用商店最新的:
image

@magicdawn
Copy link
Owner

好像这里可以改一下, 不确定这个默认行为什么时候变的
image

或者手动复制一下也行, 登录之后的 cookie header 的值, 复制出来即可
image

@magicdawn magicdawn reopened this Oct 16, 2022
@lyc8503
Copy link
Author

lyc8503 commented Oct 16, 2022

我刚刚尝试了一下, 修改插件设置之后导出的 cookie 是可以使用的, 可我直接复制访问 music.163.com 复制 header 中的 cookie 程序报错如下.

[cookie] 使用 cookie 文件: /home/xxx/yun.cookie.txt
{
  status: 400,
  body: {
    code: 20001,
    message: '登录后才可查看',
    debugInfo: null,
    data: null,
    failData: null,
    msg: '登录后才可查看'
  },
  cookie: [
    'NMTID=00OMvVD02AZ_HibO07xppMXlZl56CAAAAGD4BdM3Q; Max-Age=315360000; Expires=Wed, 13 Oct 2032 09:19:26 GMT; Path=/;'
  ]
}

@magicdawn
Copy link
Owner

确实. 使用插件导出的 cookie 即可.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants