Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

查询时机器人返回“获取 Cookie 失败” #123

Closed
HYTT0510 opened this issue Sep 22, 2021 · 8 comments
Closed

查询时机器人返回“获取 Cookie 失败” #123

HYTT0510 opened this issue Sep 22, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@HYTT0510
Copy link

输入uid查询数据时一部分 提示 获取 Cookie 失败!
目前进行的操作是

停止机器人后删除data/db/cookies.json
git checkout ./data/db/cookies.json
获取新cookie
重启 依然是此问题
image

@Arondight

This comment has been minimized.

@Arondight Arondight changed the title 提示 获取cookie失败 未找到原因 查询时报错“获取 Cookie 失败” Sep 22, 2021
@Arondight Arondight changed the title 查询时报错“获取 Cookie 失败” 查询时机器人返回“获取 Cookie 失败” Sep 22, 2021
@HYTT0510
Copy link
Author

请问一下 我不管是按照老方法通过F12还是新的办法直接使用
javascript:(function(){let domain=document.domain;let cookie=document.cookie;prompt('Cookies: '+domain, cookie)})();
获取都缺少 cookie_token= 字段 请问是为什么

@Arondight
Copy link
Owner

@HYTT0510 账号登录过期了吧,重新登录一下,按照 #120 操作一下

@Arondight Arondight added the documentation Improvements or additions to documentation label Sep 22, 2021
@HYTT0510
Copy link
Author

好的十分感谢 重新登录了好几次才有

@Arondight Arondight reopened this Sep 22, 2021
Arondight added a commit that referenced this issue Sep 22, 2021
@Arondight
Copy link
Owner

验证的字段已经更新,现在使用 account_id=cookie_token=

function isValidCookie(cookie) {
// XXX 是否要使用某个 API 真正地去验证 Cookie 合法性?
// 优点:真正地能区分 Cookie 是否有效
// 缺点:依赖网络并且耗时较多
if (cookie.includes("account_id=") && cookie.includes("cookie_token=")) {
return true;
}
return false;
}

@Myfanqie
Copy link

就是必须要像下面这样才行,cookies关键字下一个换行,然后四个空格加一个中划线,再一个空格后面跟着你的cookie
格式不能错
image

@Arondight Arondight added bug Something isn't working and removed documentation Improvements or additions to documentation labels Oct 28, 2021
@yushenzhiren
Copy link

yushenzhiren commented Nov 13, 2021

我的是直接这样报错

TypeError: cookie.match is not a function

那个cookie文件编辑是这样的

- UM_distinctid=17d19d13e29340-0862bea8817de8-57b1a33-bc160-17d19d13e2a7e9; _ga=GA1.2.309945346.1636815684; _gid=GA1.2.1670130228.1636815684; CNZZDATA1275023096=2041915167-1636807130-%7C1636807130; _MHYUUID=dee321f2-be0d-4b9b-8ca4-63df5d2af563; ltoken=1pzI7waQxx0geHnXBgCLzgGTA0pl2NpG36kMLUub; ltuid=29760307; cookie_token=jUMpPPwvJCfQpL7tRgF0XW3QyVLk5j53b4o8GgMk; account_id=xxxxxxx(我把它改成x的)

@Arondight
Copy link
Owner

我的是直接这样报错

@yushenzhirenhttps://yamlchecker.com/ 校验一下你写的配置文件是不是对的

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants