📌✨ 更多像这样的 Pinned Gist 项目请访问:https://github.com/matchai/awesome-pinned-gists
-
创建一个公开的 GitHub Gist (https://gist.github.com/)
-
创建一个拥有 gist 权限的 token 并复制. (https://github.com/settings/tokens/new)
-
根据文档获取
SESSDATA
的值并复制(https://nemo2011.github.io/bilibili-api/#/get-credential) -
在B站个人空间的链接中找到 UID (https://space.bilibili.com/282873551)
-
fork本仓库
-
编辑
.github/workflows/main.yml
中的环境变量 -
前往仓库的 Settings > Secrets
-
点击 New repository secret 并添加如下仓库秘密 (repository secrets) :
- GH_TOKEN: 刚才复制的 GitHub token
- BILI_SESSDATA: 刚才复制的B站SESSDATA值
-
前往仓库的 Actions > Update gist 并点击
enable workflows
复制此模板到你的workflow即可
- name: Update gist
uses: luyanci/bilibili-gist-py@master
with:
ghtoken: ${{ secrets.GH_TOKEN }}
gistid: 181a99b82ae47d3a6fccbd126f9d93ef
sessdata: ${{ secrets.BILI_SESSDATA }}
biliuid: '282873551' #不能删除引号,否则在长uid下会报错
-
clone本仓库
-
输入以下命令安装依赖
pip install -r requirements.txt
-
复制
.env.example
文件,更名为.env
,并按照文件内容填写即可 -
输入以下命令,进行测试
py gist.py
-
使用bilibili-api-python来获取相关信息
-
利用Github Actions自动更新Gist
本仓库使用了MIT
开源协议证书
The MIT License (MIT)
Copyright (c) 2024 luyanci
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.