Skip to main content

Bilibili alarmclock

Project description

B 站装扮编号小闹钟,用于定时刷新并展示指定装扮信息(名称、粉丝编号、头像以及剩余库存)。项目最初开发于 2021 年,目前已经针对最新的 B 站接口做了兼容性调整。

项目亮点

  • 通过非官方接口实时获取 B 站装扮信息,自动绕过 412 限流。

  • 图形界面基于 PyQt5,展示装扮名称、粉丝编号、更新时间及装扮背景。

  • 支持自定义刷新间隔,默认限制为一分钟,以避免被接口限流。

运行环境

  • Python 3.9+

  • 依赖库:PyQt5requests

  • 推荐在 Windows 环境下运行(原始项目即针对 Windows 打包),其它桌面平台可自行测试。

快速开始

  1. 克隆项目仓库并进入目录:

    git clone https://github.com/chuiba/garb_alarm_clock.git
    cd garb_alarm_clock
  2. 创建虚拟环境并安装依赖:

    python -m venv .venv
    .venv\\Scripts\\activate
    pip install PyQt5 requests
  3. 启动小闹钟:

    python -m garb_alarm_clock

    或者在 IDE 中运行 garb_alarm_clock/__init__.py 文件。

使用说明

  • 提醒编号:输入要监控的粉丝卡提醒 ID。

  • 装扮编号:输入装扮的 item_id,点击 开启 后即可加载对应数据。

  • 刷新间隔:单位为秒。小于 60 秒时会被自动重置为 60 秒,以防止频繁请求。

  • 计时器归零时会自动重新请求接口并更新界面背景、头像和粉丝编号。

接口兼容性

B 站在 2023 年之后对装扮接口增加了浏览器校验。本项目已经在 garb.py 中补充了浏览器标识头,如需二次开发请保留 User-AgentOriginReferer 这些请求头。若出现 412 错误,可尝试:

  • 确认本地网络未拦截 https://api.bilibili.com

  • 调整刷新间隔,避免短时间内请求过多

  • 在请求头中加入当前常用浏览器的 User-Agent

开发与打包

  • 代码风格基于 Cookiecutter Python Package 模板。

  • 开发依赖可通过 pip install -r requirements_dev.txt 安装。

  • 文档位于 docs/,使用 Sphinx 构建:

    cd docs
    make html

许可证

本项目以 MIT 许可证发布,详情见 LICENSE

======= History =======

0.2.0 (2025-09-20)

  • 兼容最新 B 站装扮接口,请求自动携带浏览器头信息。

  • 更新文档,补充运行指南和使用说明。

0.1.0 (2021-04-17)

  • 首次发布。

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

garb_alarm_clock-0.2.1.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

garb_alarm_clock-0.2.1-py2.py3-none-any.whl (8.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file garb_alarm_clock-0.2.1.tar.gz.

File metadata

  • Download URL: garb_alarm_clock-0.2.1.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for garb_alarm_clock-0.2.1.tar.gz
Algorithm Hash digest
SHA256 620fce8547f50584b3b29041345e1b41ff9a1c263dc5c22545a71a00dc4d4c93
MD5 40df401321710c912697bea00f8768d3
BLAKE2b-256 35da8d4ca9662c3d26a4add8db92aa580b14ee9f39b496385fcbdfc6432cfa74

See more details on using hashes here.

Provenance

The following attestation bundles were made for garb_alarm_clock-0.2.1.tar.gz:

Publisher: release.yml on chuiba/garb_alarm_clock

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file garb_alarm_clock-0.2.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for garb_alarm_clock-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f79397b2e9a3604fc077dfa6282cd325678134148e79242d7737887579186e5e
MD5 6e172b13cdcbb06adad5a306f47f406b
BLAKE2b-256 662f9909a66c05658efefa1352314c6c263f1f88060c04800a9c835f22c60782

See more details on using hashes here.

Provenance

The following attestation bundles were made for garb_alarm_clock-0.2.1-py2.py3-none-any.whl:

Publisher: release.yml on chuiba/garb_alarm_clock

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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