抛砖引玉, 分享一个 SESSDATA 的获取脚本 #180
lethargicScribe
started this conversation in
General
Replies: 3 comments
-
good, 谢谢 |
Beta Was this translation helpful? Give feedback.
0 replies
-
SESSDATA是有有效期的,需要定期刷新它,所以它其实比APP登录态短很多。 如果要更新SESSDATA,本质是获取最新cookie,其实定时执行 比如有了定时拉取video的任务如下:
它用sessdata.txt的内容鉴权, 那么可以用一个简单的curl来更新它的内容: #! /bin/bash
curl 'https://space.bilibili.com/{UID}' \
-H .... \
-b /volume1/APPData/docker/yutto/c.txt \
-c /volume1/APPData/docker/yutto/c.txt > /dev/null
awk -F' ' '{if($6=="SESSDATA") print($7)}' /volume1/APPData/docker/yutto/c.txt > /volume1/APPData/docker/yutto/sessdata.txt
|
Beta Was this translation helpful? Give feedback.
0 replies
-
浏览器开一个无痕模式再登陆,获取这个 SESSDATA 后,关闭无痕模式的网页。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
不知道什么原因, 从浏览器复制下来的 SESSDATA 经常失效, 为了在 NAS 上自动定时任务正常运行, 需要人工时不时的弄份新的下来, 非常不便. 于是就草草地写了个脚本凑合着用了. 分享出来看看能不能帮到相同需求的朋友
# requirements.txt bilibili_api_python==16.1.0
Beta Was this translation helpful? Give feedback.
All reactions