Skip to main content

Subscribe message from social medias

Project description

hk-reporter
通用订阅推送插件

pypi qq group

简介

一款自动爬取各种站点,社交平台更新动态,并将信息推送到QQ的机器人。基于 NoneBot2 开发(诞生于明日方舟的蹲饼活动)

支持的平台:

  • 微博
    • 图片
    • 文字
    • 不支持视频
    • 不支持转发的内容
  • Bilibili
    • 图片
    • 专栏
    • 文字
    • 视频链接
    • 不支持转发的内容
  • RSS
    • 从description中提取图片
    • 文字

使用方法

使用以及部署

本项目可作为单独插件使用,仅包含订阅相关功能(绝对simple和stupid),也可直接克隆项目进行使用(包含自动同意superuser,自动接受入群邀请等功能)
作为插件使用请安装nonebot-hk-reporter包,并在bot.py中加载nonebot_hk_reporter插件;或直接克隆本项目进行使用
配置与安装请参考nonebot2文档

Docker部署方法

Docker镜像地址为felinae98/nonebot-hk-reporter对应main分支,felinae98/nonebot-hk-reporter:arknights对应arknights分支。例子:

docker run --name nonebot-hk-reporter --network <network name> -d -e 'SUPERUSERS=[<Your QQ>]' -v <config dir>:/data -e 'hk_reporter_config_path=/data' -e 'HK_REPORTER_USE_PIC=True' -e 'HK_REPORTER_USE_LOCAL=True' felinae98/nonebot-hk-reporter

go-cqhttp镜像可使用felinae98/go-cqhttp-ffmpeg(数据目录为/data),需要注意,两个容器需要在同一个network中。

配置变量

  • HK_REPORTER_CONFIG_PATH (str) 配置文件保存目录,如果不设置,则为当前目录下的data文件夹
  • HK_REPORTER_USE_PIC (bool) 以图片形式发送文字(推荐在帐号被风控时使用)
  • HK_REPORTER_USE_LOCAL (bool) 使用本地chromium(文字转图片时需要),否则第一次启动会下载chromium

命令

所有命令都需要@bot触发

  • 添加订阅(仅管理员和群主):添加订阅
  • 查询订阅:查询订阅
  • 删除订阅(仅管理员和群主):删除订阅

平台代码包含:Weibo,Bilibili,RSS

各平台uid

下面均以pc站点为例

  • Weibo
    • 对于一般用户主页https://weibo.com/u/6441489862?xxxxxxxxxxxxxxx/u/后面的数字即为uid
    • 对于有个性域名的用户如:https://weibo.com/arknights,需要点击左侧信息标签下“更多”,链接为https://weibo.com/6279793937/about,其中中间数字即为uid
  • Bilibili
    • 主页链接一般为https://space.bilibili.com/161775300?xxxxxxxxxx,数字即为uid
  • RSS
    • RSS链接即为uid

文字转图片

因为可能要发送长文本,所以bot很可能被风控,如有需要请开启以图片形式发送文字,本项目使用的文字转图片方法是Chromium(经典杀鸡用牛刀)。

如果确定要开启推荐自行安装Chromium,设置使用本地Chromium,并且保证服务器有比较大的内存。

功能

  • 定时爬取指定网站
  • 通过图片发送文本,防止风控
  • 使用队列限制发送频率

鸣谢

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot-hk-reporter-0.2.4.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

nonebot_hk_reporter-0.2.4-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file nonebot-hk-reporter-0.2.4.tar.gz.

File metadata

  • Download URL: nonebot-hk-reporter-0.2.4.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.2 Linux/5.11.1-zen1-1-zen

File hashes

Hashes for nonebot-hk-reporter-0.2.4.tar.gz
Algorithm Hash digest
SHA256 a8c90172a3d5de4f7397aa98116b215e233c128afccf0616d218fbcc46d9ed59
MD5 cc579fc8b68741803b58f10089987bf8
BLAKE2b-256 3211733c4f4b4df8549c8e50dd4a34e3952ad5639f7e72c799fb0fa7df7b9165

See more details on using hashes here.

File details

Details for the file nonebot_hk_reporter-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: nonebot_hk_reporter-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.2 Linux/5.11.1-zen1-1-zen

File hashes

Hashes for nonebot_hk_reporter-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2437c8161692df46fe273071a79d6af77103c9c2b01bb5a0a3f184eeea38aa33
MD5 75329215332513fcb07e096f04f6aa33
BLAKE2b-256 4d48711e54defc478974773e4f5f5d4f72e191e15918e2964d270ce248becfe2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page