Skip to main content
NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-resolver

✨ NoneBot2 链接分享解析器插件 ✨

license pypi python

📖 介绍

适用于NoneBot2的解析视频、图片链接/小程序插件,tiktok、bilibili、twitter等实时发送!

💿 安装

  1. 使用 nb-cli 安装,不需要手动添加入口,更新使用 pip
nb plugin install nonebot-plugin-resolver
  1. 使用 pip 安装和更新,初次安装需要手动添加入口
pip install --upgrade nonebot-plugin-resolver
  1. 🚀【高级 / 进阶 / 推荐】使用脚本进行安装,优点就是及时更新 | ⚠️在可以执行nb run那个目录执行即可
curl -fsSL https://raw.gitmirror.com/zhiyu1998/nonebot-plugin-resolver/master/npr_install.sh > npr_install.sh && chmod 755 npr_install.sh && ./npr_install.sh
  1. 【必要】安装必要组件 FFmpeg
# ubuntu
sudo apt-get install ffmpeg
# 其他linux参考(群友推荐):https://gitee.com/baihu433/ffmpeg
# Windows 参考:https://www.jianshu.com/p/5015a477de3c

[!IMPORTANT] 推荐两个ffmpeg全编译版本:

  1. 【可选】安装TikTok&YouTube解析必要依赖 不建议直接使用apt不是最新版
pip install yt-dlp

⚙️ 配置

在 nonebot2 项目的.env文件中添加下表中的可选配置

XHS_CK='' #xhs cookie
DOUYIN_CK='' # douyin's cookie, 格式:odin_tt=xxx;passport_fe_beating_status=xxx;sid_guard=xxx;uid_tt=xxx;uid_tt_ss=xxx;sid_tt=xxx;sessionid=xxx;sessionid_ss=xxx;sid_ucp_v1=xxx;ssid_ucp_v1=xxx;passport_assist_user=xxx;ttwid=xxx;
IS_OVERSEA=False # 是否是海外服务器部署
RESOLVER_PROXY = "http://127.0.0.1:7890" # 代理
R_GLOBAL_NICKNAME="" # 解析前缀名
BILI_SESSDATA='' # bilibili sessdata 填写后可附加: 总结等功能
VIDEO_DURATION_MAXIMUM=480 # 视频最大解析长度,默认480s为8分钟,计算公式为480s/60s=8mins
GLOBAL_RESOLVE_CONTROLLER="" # 全局禁止的解析,示例 GLOBAL_RESOLVE_CONTROLLER="bilibili,dy" 表示禁止了哔哩哔哩和抖,GLOBAL_RESOLVE_CONTROLLER=""说明都不禁止,(大部分是缩写)请严格遵守选项: bilibili,dy,tiktok,ac,twitter,xiaohongshu,youtube.netease,kugou,wb

🕹️ 开启 & 关闭解析

使用以下命令可以控制对当前群是否开启/关闭解析:

@机器人 开启解析
@机器人 关闭解析
查看关闭解析

🤳🏿 在线观看如何获取 Cookie

由群友 @麦满分 提供

https://github.com/user-attachments/assets/7ead6d62-a36c-4e8d-bb5d-6666749dfb26

youtube 解析可能存在的问题

  • 网络问题, 自行解决
  • 解析失败可能是因为人机检测,建议先自行使用 yt-dlp 测试,确定后将 youtube 的 cookies 以 Netscape 的格式导出为 ytb_cookies.txt,放到 nonebot 工作目录

🎉 使用 & 效果图

开发 && 发版

发版 Action:

git tag <tag_name>

git push origin --tags

贡献

同时感谢以下开发者对 Nonebot - R插件 作出的贡献:

Metadata

Release files for nonebot-plugin-resolver 1.2.32

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-resolver 1.2.32
File Size Uploaded Provenance Actions
nonebot_plugin_resolver-1.2.32.tar.gz 34.0 kB Without provenance Details for nonebot_plugin_resolver-1.2.32.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-resolver 1.2.32
File Interpreter ABI Platform Actions
nonebot_plugin_resolver-1.2.32-py3-none-any.whl Python 3 none any Details for nonebot_plugin_resolver-1.2.32-py3-none-any.whl

Total release size: 72.8 kB

Release files / nonebot_plugin_resolver-1.2.32.tar.gz

Download URL nonebot_plugin_resolver-1.2.32.tar.gz
Size 34.0 kB
Tags Source
SHA-256 checksum
How to use checksums
25f4ef28bcfed7996622d3b1f0c38e0264dbf66b35284038160600e7466a4e68
BLAKE2b-256 checksum
How to use checksums
6c564c1e2b73ac28bfaa0114b663f3577a2b0694a8f759f5bcd3e8c8733acc6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / nonebot_plugin_resolver-1.2.32-py3-none-any.whl

Download URL nonebot_plugin_resolver-1.2.32-py3-none-any.whl
Size 38.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1043e65d66982c0c18a1f1fd5f4ffd7ed712e05202eb9854537261ad1d68f74a
BLAKE2b-256 checksum
How to use checksums
dd0c1f19f87dfc40a101add6a8745f107a4ed9170282faba9856762fe14b94cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for nonebot-plugin-resolver 1.2.32

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.32 This release

2 release files No provenance

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