Skip to main content
logo

✨ nonebot-plugin-douyin-subscribe ✨

LICENSE pypi python uv
ruff pre-commit

📖 介绍

订阅抖音和 B 站作者的新作品及动态,并将作品分享链接交给 nonebot-plugin-parser 下载和发送。 支持抖音作者主页链接、作者主页短链、sec_user_id,以及 B 站作者主页和作品链接, 每个会话独立记录已发送作品。

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-ifollow --upgrade

使用 pypi 源安装

nb plugin install nonebot-plugin-ifollow --upgrade -i "https://pypi.org/simple"

使用清华源安装

nb plugin install nonebot-plugin-ifollow --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
uv
uv add nonebot-plugin-ifollow

安装仓库 master 分支

uv add git+https://github.com/ByteColtX/nonebot-plugin-ifollow@master
pdm
pdm add nonebot-plugin-ifollow

安装仓库 master 分支

pdm add git+https://github.com/ByteColtX/nonebot-plugin-ifollow@master
poetry
poetry add nonebot-plugin-ifollow

安装仓库 master 分支

poetry add git+https://github.com/ByteColtX/nonebot-plugin-ifollow@master

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot_plugin_ifollow"]
使用 nbr 安装(使用 uv 管理依赖可用)

nbr 是一个基于 uv 的 nb-cli,可以方便地管理 nonebot2

nbr plugin install nonebot-plugin-ifollow

使用 pypi 源安装

nbr plugin install nonebot-plugin-ifollow -i "https://pypi.org/simple"

使用清华源安装

nbr plugin install nonebot-plugin-ifollow -i "https://pypi.tuna.tsinghua.edu.cn/simple"

⚙️ 配置

在 nonebot2 项目的.env文件中添加下表中的可选配置。平台网页接口可能随时调整,接口受限时可配置有效 Cookie。

配置项 必填 默认值 说明
IFOLLOW_SUBSCRIBE_INTERVAL 否 300 所有平台共享的轮询间隔,单位为秒,最小 30 秒
IFOLLOW_SUBSCRIBE_COUNT 否 20 每个平台每次拉取的最新内容数,范围 1-50
IFOLLOW_DOUYIN_COOKIE 否 无 抖音网页 Cookie,接口受限时填写
IFOLLOW_BILIBILI_COOKIE 否 无 B 站 Cookie,接口或视频下载受限时填写

示例:

IFOLLOW_SUBSCRIBE_INTERVAL=300
IFOLLOW_SUBSCRIBE_COUNT=20
IFOLLOW_DOUYIN_COOKIE="你的抖音网页 Cookie"
IFOLLOW_BILIBILI_COOKIE="你的 B 站 Cookie"

插件依赖 nonebot-plugin-parser 发送视频,parser 的视频解析还需要安装 ffmpeg。订阅数据由 nonebot-plugin-localstore 持久化到插件数据目录,不要把 Cookie 或订阅数据提交到代码仓库。

🎉 使用

指令表

指令 权限 需要@ 范围 说明
爱播帮助 群员 否 群聊、私聊 查看帮助
爱播订阅 <作者主页或作品链接> 群员 否 群聊、私聊 订阅一个抖音或 B 站作者
爱播订阅列表 群员 否 群聊、私聊 查看当前会话的订阅
爱播取消订阅 <序号或作者主页/作品链接> 群员 否 群聊、私聊 取消一个作者订阅

订阅作者

爱播订阅 https://www.douyin.com/user/MS4wLjABAAAA...
爱播订阅 https://v.douyin.com/作者主页短链/
爱播订阅 MS4wLjABAAAA...
爱播订阅 https://space.bilibili.com/123456
爱播订阅 https://www.bilibili.com/video/BV1xxxxxxxxx

也可以引用包含抖音或 B 站作品分享链接的消息后发送 爱播订阅。插件会读取被引用的原消息, 从作品页解析作者主页并完成订阅;该功能需要当前适配器支持 get_msg 接口。

群友A:4.38 复制打开抖音,看看【小葵日记的作品】喵喵喵 https://v.douyin.com/0l0Sigjl5jM/
群友A(引用上一条消息):爱播订阅

首次订阅只记录当前最新作品或动态,不会补发历史内容。之后轮询发现新内容时,插件会将作品链接交给 nonebot-plugin-parser 下载并发送到订阅会话。

管理订阅

爱播订阅列表
爱播取消订阅 https://www.douyin.com/user/MS4wLjABAAAA...

订阅状态按平台、作者和目标会话保存;同一个作者可以订阅到多个会话,各会话分别记录推送游标。

🎨 效果图

暂无示例图。

Metadata

Release files for nonebot-plugin-ifollow 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-ifollow 1.0.0
File Size Uploaded
nonebot_plugin_ifollow-1.0.0.tar.gz 20.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-ifollow 1.0.0
File Interpreter ABI Platform
nonebot_plugin_ifollow-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.7 kB

Release files / nonebot_plugin_ifollow-1.0.0.tar.gz

Download URL nonebot_plugin_ifollow-1.0.0.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
81b4e942ce310236e9e86e3a3e3f3bfe4ab9b2ce732bde83010c0bdd4ca365e5
BLAKE2b-256 checksum
How to use checksums
640d903814ae174d3aa234e11dcff13a651f49a1610c5782f19b69586291f860
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / nonebot_plugin_ifollow-1.0.0-py3-none-any.whl

Download URL nonebot_plugin_ifollow-1.0.0-py3-none-any.whl
Size 25.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09ffbe251db39795c507cd3ee46a21756fc824750557e39f1371c036391966ef
BLAKE2b-256 checksum
How to use checksums
68b8ad64d57c21f18dcdea2f1d42ebc901568dfefff1c6b07b2602699599866b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page