282 Commits

Author SHA1 Message Date
Azide
c96dd85b22
独立 bilibili-live 的 SchedConf (#473)
*  独立 bilibili-live 的 SchedConf

*  修正测试

*  bilibili和bilibili-live共用http_client

* 🐛 不在__init__中修改_client_refresh_time

*  将刷新浏览器变更为类方法

* ♻️ seperate BilibiliClient

Co-authored-by: felinea98 <me@felinae98.cn>

---------

Co-authored-by: felinea98 <me@felinae98.cn>
2024-03-19 10:27:37 +08:00
Azide
a42a65523e
使用 yarl.URL 拼接 outer_url (#496)
*  显式依赖 yarl

*  使用 yarl.URL 处理 outer_url
2024-03-19 10:26:38 +08:00
pre-commit-ci[bot]
9b514263aa
⬆️ auto update by pre-commit hooks (#465)
* ⬆️ auto update by pre-commit hooks

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.9 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.9...v0.2.0)
- [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1)
- [github.com/pre-commit/mirrors-eslint: v9.0.0-alpha.0 → v9.0.0-alpha.2](https://github.com/pre-commit/mirrors-eslint/compare/v9.0.0-alpha.0...v9.0.0-alpha.2)

* 💄 auto fix by pre-commit hooks

* 💄 auto fix by pre-commit hooks

* 🐛 fix some merge error

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Azide <rukuy@qq.com>
2024-03-17 17:21:23 +08:00
AzideCupric
3cda6bfa0d
🐛 Arknights 公告分类 过滤不可访问的 URL (#495) 2024-03-10 21:52:30 +08:00
uy/sun
b6e68730b7
⬆️ 适配 Pydantic V2 (#484)
* ⬆️ 适配 Pydantic V2

* 🐛 修复测试报错

* 🐛 适配忘记的 from_orm

* 🐛 忘记的 class-based `config`

* 🐛 更新 red 适配器版本
2024-02-29 19:21:25 +08:00
Azide
4cfa672b82 🐛 修复文本替换,同步测试用文件内容 2024-02-23 10:22:01 +08:00
Azide
60812c2167 🐛 不使用 updateAt 作为 Arknights 公告的 get_date 返回值 2024-02-23 10:22:01 +08:00
Azide
700196c888 🔥 移除 mcbbsnews platform 2024-02-21 17:02:39 +08:00
AzideCupric
5fc5e292c4 优化 Post 的 __str__ 输出 (#476)
*  优化Post类的__str__

*  补充转发测试
2024-02-16 09:46:13 +08:00
Azide
f202071e9f 添加 Theme 功能 2024-02-16 09:46:13 +08:00
uy/sun
a47a60f49c
⬆️ 升级至 saa 0.5.0 (#466) 2024-02-08 14:03:08 +08:00
pre-commit-ci[bot]
f6ee4a4c1b
⬆️ auto update by pre-commit hooks (#416)
* ⬆️ auto update by pre-commit hooks

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.292 → v0.1.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.292...v0.1.9)
- [github.com/pycqa/isort: 5.12.0 → 5.13.2](https://github.com/pycqa/isort/compare/5.12.0...5.13.2)
- [github.com/psf/black: 23.9.1 → 23.12.1](https://github.com/psf/black/compare/23.9.1...23.12.1)
- [github.com/pre-commit/mirrors-prettier: v3.0.3 → v4.0.0-alpha.8](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.3...v4.0.0-alpha.8)
- [github.com/pre-commit/mirrors-eslint: v8.50.0 → v9.0.0-alpha.0](https://github.com/pre-commit/mirrors-eslint/compare/v8.50.0...v9.0.0-alpha.0)

* 💄 auto fix by pre-commit hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-02 10:24:42 +08:00
felinae98
badb26419e ⬆️ upgrade nonebot_plugin_saa 2023-11-22 10:44:51 +08:00
Sherkey
1997b57761
BISON_OUTER_URL配置改进 (#405)
* 📝 修复文档中的错误链接

*  bison_outer_url使用property包装

* 📝 通过vue动态生成BISON_OUTER_URL的配置建议

* 💄 auto fix by pre-commit hooks

* 📝 优化文档视觉效果

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-29 20:54:41 +08:00
Azide
05d01aee6c 🐛 published_element add is not None 2023-10-15 23:26:35 +08:00
Azide
efe792ec66 ♻️ 精简assert 2023-10-15 23:26:35 +08:00
Azide
2d8b138e86 🐛 更改标注类型的格式 2023-10-15 23:26:35 +08:00
Azide
77e9fc3b50 🐛 修复一些类型错误 2023-10-15 23:26:35 +08:00
AzideCupric
3039ba7bf9
🐛 处理topic_info字段缺失的问题 (#354)
* 🐛 处理topic_info字段缺失的问题

*  补充测试

* ♻️ dict get 默认为 None

Co-authored-by: felinae98 <731499577@qq.com>

* ♻️ 原地tp?

Co-authored-by: felinae98 <731499577@qq.com>

---------

Co-authored-by: felinae98 <731499577@qq.com>
2023-09-04 20:43:51 +08:00
felinae98
e7dcfdee50
提供批量 api 接口 (#290)
* 🚧 add batch api

* 🚧 support batch in scheduler

*  use batch api in bilibili-live

 patch platform_manager directly

 use batch api in bilibili-live

 patch platform_manager directly

* ♻️ refactor var name

* 🐛 fix test

* 🐛 fix scheduler

* 🐛 fix test
2023-08-29 21:12:42 +08:00
UKM
cfa91df5e4
🐞 fix(text-similarity): 修复除0报错 (#302)
* 🐞 fix(text-similarity): 修复除0报错

没有考虑到bilibili的推送出现动态或者视频简介长度为零的情况,出现文本相似度除0Error

* 🧪 test(bilibili): 添加视频动态内容为空的情况的测试

* 🧪 test(text-similarity): 增加文本相似度函数的测试

* Update test_rss.py

* 📃 docs(text_similarity): 添加文本相似度函数的注释

* 🦄 refactor(text_similarity): 重构文本相似度的比较方法

* 🎈 perf(similar_text): 将比较函数的return改成raise

* 🦄 refactor(text_similarity): 重构文本相似度比较方法

* Update nonebot_bison/platform/bilibili.py

Co-authored-by: felinae98 <731499577@qq.com>

* Update nonebot_bison/platform/rss.py

Co-authored-by: felinae98 <731499577@qq.com>

---------

Co-authored-by: felinae98 <731499577@qq.com>
2023-08-27 16:28:26 +08:00
Cateon Huo
fd3f0ddddc
适配明日方舟新版公告栏API (#305)
* 🔨 适配明日方舟新版公告栏API

*  更新测试

* 💄 auto fix by pre-commit hooks

---------

Co-authored-by: GuGuMur <222153315@qq.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-07-27 12:13:23 +08:00
Azide
fc699d80ce ⬆️ 升级dev工具依赖
💄 auto fix by pre-commit hooks
2023-07-18 21:43:25 +08:00
Azide
bf788ff72a 🚨 移除noqa: E501
💄 auto fix by pre-commit hooks
2023-07-18 21:43:25 +08:00
Azide
e50eb5d70b 👷 添加ruff actions
🐛 分支应该是main而不是master

💄 auto fix by pre-commit hooks

🔥 dependabot.yml的registrys需要token,先删除
2023-07-18 21:43:25 +08:00
Azide
7d4eb7785c 🎨 按ruff调整测试代码 2023-07-18 21:43:25 +08:00
UKM
9838e25bad
🎈优化RSS推送的内容 (#259)
* 🧪 test(tests): 添加了RSS的单元测试

* 🎈 perf(rss and test): 优化了RSS部分源标题正文重复的问题

部分RSS源(RSSHub的Twitter)存在正文当标题用的情况,导致推送的时候呈现为两段重复的文字,现通过Jaccard相似系数来判断是否需要去重

* Update nonebot_bison/platform/rss.py

Co-authored-by: AzideCupric <57004769+AzideCupric@users.noreply.github.com>

* Update nonebot_bison/platform/rss.py

Co-authored-by: AzideCupric <57004769+AzideCupric@users.noreply.github.com>

* 🐞 fix(platform/rss): 修复了漏掉相似文本在后端位置的问题

* 🐞 fix(rss): 修正一些feed无法正确识别时间的bug

一些feed时间只有updated标签或者没有,原先的代码只能解析用published标签的时间

felinae98#275

* 🎈 perf(rss): 更改字符串相似度比较方法

从Jaccard相似系数比较相似度改为通过最长公共子序列来比较

* 🦄 refactor(rss): 重构实现字符串相似度比较的方法

使用标准库difflib代替原先手搓的LCS

* Update nonebot_bison/utils/__init__.py

Co-authored-by: felinae98 <731499577@qq.com>

* Update nonebot_bison/platform/rss.py

* Update nonebot_bison/platform/rss.py

---------

Co-authored-by: AzideCupric <57004769+AzideCupric@users.noreply.github.com>
Co-authored-by: felinae98 <731499577@qq.com>
2023-07-18 11:54:49 +08:00
Azide
4f7a3ebfbe 🐛 修复bililive订阅没有直播间的用户报错的问题 2023-07-17 20:29:12 +08:00
Azide
147f858a31 🐛 修复B站订阅没有动态的用户时报错的问题(第二次) 2023-07-17 20:29:12 +08:00
felinae98
a1b4f2fb27 🚚 rename config_manager to sub_manager 2023-06-11 15:32:57 +08:00
felinae98
3ccdcc844b ♻️ adjust card 2023-06-11 15:32:57 +08:00
felinae98
9b679cb827 ♻️ use plaintext promot 2023-06-11 15:32:57 +08:00
felinae98
2ba9542b63 🚧 use saa-send 2023-06-06 03:30:50 +08:00
felinae98
5010ca1ac5 🚧 sunset get_bot 2023-06-06 03:30:50 +08:00
AzideCupric
39c045c63f subs-io适配引入saa后的新数据库结构 (#219的subs-io部分) (#224)
* 🚚 将nbesf_model统一放到目录中

*  添加v2版本的nbesf

*  使subs_import支持导入多个版本的nbesf文件

*  使用saa的AllSupportedPlatformTarget

* 🚧 use deserialize

---------

Co-authored-by: felinae98 <731499577@qq.com>
2023-06-06 03:30:50 +08:00
felinae98
da8e988ee9 ♻️ use saa 2023-06-06 03:30:50 +08:00
felinae98
4118329bb0 🚧 remove User type 2023-06-06 03:30:50 +08:00
UKM
a8d632ffa3
🐞 更换获取B站用户名的api (#261)
* 🐞 fix(platform-bilibili): 更改获取b站用户名的api

原先的api又用不了,换了一个api

* 🧪 test(tests/bilibili): 添加了部分B站的单元测试

1.修正番剧链接识别正则表达式出错
2.添加了直播和番剧的解析目标的单元测试
2023-05-23 00:05:50 +08:00
LambdaYH
3f98b6c214 🐛 修复ff14公告链接 2023-05-20 15:57:23 +08:00
AzideCupric
24b6d60d69
开播提醒推送的图片改为使用直播间封面 (#249)
*  为bilibili直播添加下播提醒,添加直播分区信息

🚸 开播提醒推送的图片改为使用直播间封面

* ♻️ 使用Enum

* 🐛 修复bilibili发送视频动态时不推送视频标题的问题

* 🎨 调整LiveAction的注释和jaccard函数代码位置

* 🚨 修改RawPost类型定义,优化bililive类型显示
2023-05-14 01:41:25 +08:00
UKM
85319daca1
👽 解决添加Blibili订阅时,获取用户名时的报错 (#248)
* fix felinae98#246

* fix felinae98#246 (test)

* fix felinae98#246 (bilibili-live)
2023-05-02 18:45:01 +08:00
AzideCupric
ce950ac4ab
📝 在文档和log中强调bison网页后台网址不能直接访问,并优化部分文档的表达 (#235) 2023-04-12 10:49:58 +08:00
felinae98
271bd1f1b9 ⬆️ upgrade to latest nonebot 2023-04-04 01:05:21 +08:00
AzideCupric
4e304a43b1
通过 nb-cli 实现数据库一键导入导出 (#210)
* feat: 实现导出存储的订阅信息的功能

* test: 编写导出功能测试

* test: 使用tmp_path

* feat: 实现导入订阅文件功能

* refactor: 将订阅导入导出部分独立出来

* fix: 修复一些拼写错误
test: 完成import的第一个测试

* feat: 将订阅导入导出函数加入nb script

test: 添加cli测试

* test: 完善subs import测试

* 🐛 fix nb cli entrypoint name error

* fix: 修改错误的entry_point, 关闭yaml导出时对键名的排序

* fix: 使用更简短的命令名

* 🚚 将subs_io迁移到config下

* ♻️ 不再使用抛出异常的方式创建目录

* refactor: 将subscribe_export类转为函数

* refactor: 将subscribe_import类转为函数

* refactor: 根据重写的subs_io重新调整cli

* test: 调整重写subs_io后的test

* chore: 清理未使用的import内容

* feat(cli): 将--yaml更改为--format

* test: 调整测试

* fix(cli): 为import添加不支持格式的报错

*  improve export performace

* feat: subscribes_import函数不再需要传入参数函数,而是指定为add_subscribes

fix: nbesf_parser在传入str时将调用parse_raw, 否则调用parse_obj

* feat: subscribes_import现在会根据nbesf_data的版本选择合适的导入方式

* fix(test): 调整测试

* feat: nb bison export命令不再将文件导出到data目录,而是当前工作目录

* docs: 增添相关文档

* fix(test): 修复错误的变量名

---------

Co-authored-by: felinae98 <731499577@qq.com>
2023-03-19 16:29:05 +08:00
uy/sun
9581887994
🎨 调整旧版数据库加载逻辑 (#212) 2023-03-09 17:58:26 +08:00
uy/sun
90816796c7
🚚 修改 nonebot_bison 项目结构 (#211)
* 🎨 修改 nonebot_bison 目录位置

* auto fix by pre-commit hooks

* 🚚 fix frontend build target

* 🚚 use soft link

* Revert "🚚 use soft link"

This reverts commit de21f79d5ae1bd5515b04f42a4138cb25ddf3e62.

* 🚚 modify dockerfile

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: felinae98 <731499577@qq.com>
2023-03-09 17:32:51 +08:00
felinae98
d07657aeed
🗃️ 又切换回 sqlalchemy,但是 2.0 (#206)
* change: 又切换回 sqlalchemy,但是 2.0

* 将 subscribe 表的两个 json 字段设置为 not null

---------

Co-authored-by: hemengyang <hmy0119@gmail.com>
2023-03-03 18:10:12 +08:00
felinae98
c3a764581e
👷 use pytest-xdist to accelerate test (#186)
* 👷 use pytest-xdist to accelerate test

*  mark flaky

* test(mcbbsnews): 删除重复测试,为测试添加flaky

---------

Co-authored-by: hemengyang <hmy0119@gmail.com>
Co-authored-by: AzideCupric <rukuy@qq.com>
2023-03-03 17:16:15 +08:00
felinae98
0201d5b316
⬆️ 升级至 NoneBug 0.3
* 🚧 第一次尝试 50/82

* 62/82 调整了清除数据库的位置

* 🚧 pytest-mock

* 🚧 fix test_send

* 🚧 intruduce app request

* 🚧 close and remove tinydb after each test

* 🚧 clean ScheduleTimeWeight table

* 🚧 reload http module to test proxy

*  合并 main 的代码

* 🚧 在每次测试结束后关闭browser

* 🧑‍💻 在mcbbsnews渲染异常时添加logger

---------

Co-authored-by: hemengyang <hmy0119@gmail.com>
Co-authored-by: Azide <rukuy@qq.com>
2023-03-03 15:12:25 +08:00
AzideCupric
d7e684e8e5
💄 调整订阅回复内容结构以优化群内订阅体验 (#198)
style(admin-page): 为`后台管理`命令添加别名

test: 调整相关测试的文本
2023-02-18 19:51:19 +08:00