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

空间开启第三方登录,如钉钉,获取文档会获取失败 #16

Open
geekrainy opened this issue Aug 17, 2023 · 5 comments
Open

Comments

@geekrainy
Copy link

实际测试,个人账户登录后,若空间开启第三方登录,则获取 cookie 页面是登录页的 cookie,无法获得 appData.book 变量。建议配置文件手动配置 cookie 或登录流程增加 OAuth 认证。 : )

@vannvan
Copy link
Owner

vannvan commented Aug 17, 2023

image

可否尝试一下在上面的位置打印一下实际爬的url呢,上次有位朋友无法获取appData.book是因为此处cookie无效重定向到了登录页面,原因是因为在墙外面

@geekrainy
Copy link
Author

确实是重定向到登录页了,首次在浏览器登录需要钉钉扫码进入空间。手动先登录把 cookie 替换就可以正常爬了,多个二次认证的逻辑。

@vannvan
Copy link
Owner

vannvan commented Aug 18, 2023

确实是重定向到登录页了,首次在浏览器登录需要钉钉扫码进入空间。手动先登录把 cookie 替换就可以正常爬了,多个二次认证的逻辑。

那就是可以正常导出了

@Roamoin
Copy link

Roamoin commented Apr 23, 2024

我这边由于没有账号, 使用的是钉钉登入, 只能获取cookie, 请问我应该如何修改yuque.config.json 使之能够生效?

@vannvan
Copy link
Owner

vannvan commented Apr 23, 2024

我这边由于没有账号, 使用的是钉钉登入, 只能获取cookie, 请问我应该如何修改yuque.config.json 使之能够生效?

  1. 在浏览器任意API请求Request Headers找到cookie,把cookie整段复制出来
image
  1. ytool运行的某个目录新建 docs/.meta 两级文件夹,再新建cookies.json文件,加入以下内容:
{
    "expired": 1712477721324, // 这个时间戳可以是此时此刻,在浏览器Console用`Date.now()`生成就可以
    "data": "复制出来的cookie字符串"
}
  1. 直接运行 ytool pull,接下来就会进入到交互式环节

@vannvan vannvan mentioned this issue Apr 23, 2024
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

3 participants