{"id":13432096,"url":"https://github.com/HCLonely/hexo-bilibili-bangumi","last_synced_at":"2025-03-16T23:30:34.359Z","repository":{"id":36979098,"uuid":"239132562","full_name":"HCLonely/hexo-bilibili-bangumi","owner":"HCLonely","description":"hexo 番剧页面插件，可选数据源：Bilibili, Bangumi","archived":false,"fork":false,"pushed_at":"2025-03-03T03:41:47.000Z","size":4888,"stargazers_count":477,"open_issues_count":8,"forks_count":27,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-07T16:47:23.791Z","etag":null,"topics":["bangumi","bilibili","hexo","hexo-bilibili","hexo-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HCLonely.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-08T12:58:10.000Z","updated_at":"2025-03-03T03:41:43.000Z","dependencies_parsed_at":"2023-12-27T10:24:11.572Z","dependency_job_id":"92bebe2e-9a86-40b5-8533-9589e6bd9695","html_url":"https://github.com/HCLonely/hexo-bilibili-bangumi","commit_stats":{"total_commits":564,"total_committers":7,"mean_commits":80.57142857142857,"dds":"0.22695035460992907","last_synced_commit":"7b09b3d7aa016233ab93b09d1947f9606970b6c6"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HCLonely%2Fhexo-bilibili-bangumi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HCLonely%2Fhexo-bilibili-bangumi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HCLonely%2Fhexo-bilibili-bangumi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HCLonely%2Fhexo-bilibili-bangumi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HCLonely","download_url":"https://codeload.github.com/HCLonely/hexo-bilibili-bangumi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243949754,"owners_count":20373650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bangumi","bilibili","hexo","hexo-bilibili","hexo-plugin"],"created_at":"2024-07-31T02:01:08.556Z","updated_at":"2025-03-16T23:30:34.339Z","avatar_url":"https://github.com/HCLonely.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","相关插件"],"sub_categories":["直播脚本"],"readme":"# hexo-bilibili-bangumi\n\n![](https://nodei.co/npm/hexo-bilibili-bangumi.png?downloads=true\u0026downloadRank=true\u0026stars=true)\n\n## 介绍\n\n**为 Hexo 添加[哔哩哔哩](https://www.bilibili.com/)/[Bangumi](https://bangumi.tv/)追番/追剧页面，参考自[hexo-douban](https://github.com/mythsman/hexo-douban)**.\n\n[Demo](https://demo.hclonely.com/bangumis/)\n\n## 安装\n\n```bash\n$ npm install hexo-bilibili-bangumi --save\n```\n\n------------\n\n## 配置\n\n将下面的配置写入站点的配置文件 `_config.yml` 里(不是主题的配置文件).\n\n``` yaml\nbangumi: # 追番设置\n  enable: true\n  source: bili\n  bgmInfoSource: 'bgmv0'\n  path:\n  vmid:\n  title: '追番列表'\n  quote: '生命不息，追番不止！'\n  show: 1\n  lazyload: true\n  srcValue: '__image__'\n  lazyloadAttrName: 'data-src=__image__'\n  loading:\n  showMyComment: false\n  pagination: false\n  metaColor:\n  color:\n  webp:\n  progress:\n  progressBar:\n  extraOrder:\n  order: latest\n  proxy:\n    host: '代理host'\n    port: '代理端口'\n  extra_options:\n    key: value\n  coverMirror:\ncinema: # 追剧设置\n  enable: true\n  path:\n  vmid:\n  title: '追剧列表'\n  quote: '生命不息，追剧不止！'\n  show: 1\n  lazyload: true\n  srcValue: '__image__'\n  lazyloadAttrName: 'data-src=__image__'\n  loading:\n  metaColor:\n  color:\n  webp:\n  progress:\n  progressBar:\n  extraOrder:\n  order:\n  extra_options:\n    key: value\n  coverMirror:\ngame: # 游戏设置，仅支持source: bgmv0\n  enable: true\n  path:\n  source: bgmv0\n  vmid:\n  title: '游戏列表'\n  quote: '生命不息，游戏不止！'\n  show: 1\n  lazyload: true\n  srcValue: '__image__'\n  lazyloadAttrName: 'data-src=__image__'\n  loading:\n  metaColor:\n  color:\n  webp:\n  progress:\n  progressBar:\n  extraOrder:\n  order:\n  extra_options:\n    key: value\n  coverMirror:\n```\n\n\u003e 带*为必填选项！\n\n- **enable**: 是否启用\n- **source**: 数据源，仅支持追番，追剧仅支持哔哩哔哩源。`bili`: [哔哩哔哩源](https://www.bilibili.com/), `bgmv0`: **建议**[Bgm Api源(api.bgm.tv)](https://bgm.tv/), `bangumi`: [Bangumi源(bangumi.tv)](https://bangumi.tv/), `bgm`: [Bangumi源(bgm.tv)](https://bgm.tv/)\n- **bgmInfoApi**: 获取Bangumi番剧信息时使用的Api，仅使用Bangumi源时此选项生效。`bgmApi`: [Bangumi Api](https://github.com/bangumi/api/), `bgmSub`: [Bangumi-Subject](https://github.com/czy0729/Bangumi-Subject)\n- **proxy**: 代理设置，仅在使用支持`bgm`源追番时生效。默认`false`\n- **path**: 页面路径，默认`bangumis/index.html`, `cinemas/index.html`\n- **vmid**: 哔哩哔哩的 `vmid(uid)`[如何获取？](#获取-bilibili-uid)/Bangumi的用户`用户名`(source为`bgmv0`时使用)[如何获取？](#获取-bangumi-用户名)/Bangumi的用户`id`(source为`bgm`或`bangumi`时使用)[如何获取？](#获取-bangumi-id)\n- **title**: 该页面的标题\n- **quote**: 写在页面开头的一段话，支持 html 语法，可留空。\n- **show**: 初始显示页面：`0: 想看`, `1: 在看`, `2: 看过`，默认为`1`\n- **lazyload**: 是否启用图片懒加载，如果与主题的懒加载冲突请关闭，默认`true`\n- **srcValue**: 设置封面图的默认`src`值, `__image__`为封面链接, `__loading__`为loading图片链接, `lazyload`选项为`false`时此选项生效\n- **lazyloadAttrName**: 设置封面图的属性与属性值, 例`lazyloadAttrName: 'data-src=__image__'`代表为`img`元素添加`data-src`属性, 其值为图片链接, `lazyload`选项为`false`时此选项生效\n- **loading**: 图片加载完成前的 loading 图片，需启用图片懒加载\n- **metaColor**: meta 部分(简介上方)字体颜色（十六进制的颜色代码需要添加引号：`metaColor: '#FFFFFF'`）\n- **color**: 简介字体颜色\n- **webp**: 番剧封面使用`webp`格式(此格式在`safari`浏览器下不显示，但是图片大小可以缩小 100 倍左右，仅支持哔哩哔哩源), 默认`true`\n- **progress**: 获取番剧数据时是否显示进度条，默认`true`\n- **progressBar**: 追番页面是否显示进度条，默认`true`。仅支持`bili`和`bgmv0`数据源\n- **extraOrder**: 手动添加的番剧/追剧数据是否优先显示，`1`为优先，其它为不优先\n- **showMyComment**: 使用`bgm`源时显示自己的评价及评论，默认`false`\n- **pagination**: 分页优化，只将第一页的数据渲染到`html`文件中，其余数据将通过异步请求加载，避免番剧过多时html文件过大导致页面加载缓慢，建议番剧较多时使用，默认`false`\n- **order**: 排序，支持`latest`(默认，按添加时间排序), `score`(评分升序), `-score`(评分降序)\n- **extra_options**: 此配置会扩展到Hexo`page`变量中\n- **coverMirror**: 封面镜像缓存配置，默认为空。追番，追剧需分别配置。可以将有防盗链的图片引用到网页，并成功显示。可以将 http 图片引用到 https 页面而不出现证书问题。可以将 xxx 的图片，成功加载。可以将比较慢的图片资源，加快显示。可以使用自建或者是第三方的图片镜像服务，例如`https://image.baidu.com/search/down?url=`百度的接口，但是图片大小不能超过5M(据说不稳定，个人目前使用没啥问题)。其他镜像地址收集之网络，未全部测试。推荐在出现403错误时或者图片加载特别慢时使用。\n\n  ```\n  # 图片镜像服务\n  https://image.baidu.com/search/down?url=\n  https://img.noobzone.ru/getimg.php?url=\n  https://images.weserv.nl/?url=\n  https://collect34.longsunhd.com/source/plugin/yzs1013_pldr/getimg.php?url=\n  https://pic1.xuehuaimg.com/proxy/\n  https://search.pstatic.net/common?src=\n  ```\n\n## 使用\n\n\u003e 仅`bili`和`bgmv0`源支持在追番页面显示追番进度。\n\n1. 在`hexo generate`或`hexo deploy`之前使用`hexo bangumi -u`命令更新追番数据，使用`hexo cinema -u`命令更新追剧数据！\n\n    - 使用bili源时，如果要在追番页面显示追番进度，需使用`hexo bangumi -u 'SESSDATA'`, `SESSDATA`替换为哔哩哔哩cookie中的`SESSDATA`值。例`hexo bangumi -u 'df***EC'`\n\n2. 删除数据命令:`hexo bangumi -d`/`hexo cinema -d`\n\n## 获取 Bilibili uid\n\n登录哔哩哔哩后前往[https://space.bilibili.com/](https://space.bilibili.com/)页面，网址最后的一串数字就是 `uid`\n\n***需要将追番列表设置为公开！***\n\n## 获取 Bangumi 用户名\n\n登录[Bangumi](https://bangumi.tv/)后打开控制台(`Ctrl`+`Shift`+`J`)，输入`document.getElementById('header').getElementsByTagName('a')[0].getAttribute('href').split('/').at(-1)`回车，下面会输出`用户名`\n\n## 获取 Bangumi id\n\n登录[Bangumi](https://bangumi.tv/)后打开控制台(`Ctrl`+`Shift`+`J`)，输入`CHOBITS_UID`回车，下面会输出`id`\n\n## 示例\n\n![示例图片](https://github.com/HCLonely/hexo-bilibili-bangumi/raw/master/example.png)\n\n## 手动添加番剧/追剧数据\n因为某些番剧在哔哩哔哩上没有，但是又想在hexo中展示，怎么办呢？现在支持手动添加番剧数据了！\n\n在 `sources/_data/` 目录下新建文件，命名为 `extra_bangumis.json`(追番数据)或`extra_cinemas.json`(追剧数据) ，并添加以如下内容:\n```json\n{\n  \"watchedExtra\": [\n    {\n      \"title\": \"缘之空\",\n      \"type\": \"番剧\",\n      \"area\": \"日本\",\n      \"cover\": \"https://cdn.jsdelivr.net/gh/mmdjiji/bangumis@main/Yosuga-no-Sora/cover.jpg\",\n      \"totalCount\": \"全12话\",\n      \"id\": 0,\n      \"follow\": \"不可用\",\n      \"view\": \"不可用\",\n      \"danmaku\": \"不可用\",\n      \"coin\": \"不可用\",\n      \"score\": \"不可用\",\n      \"des\": \"远离都市的田园小镇，奥木染。春日野悠带着妹妹穹，来到了这座城镇。坐落在这里的是，儿时暑假经常造访的充满回忆的已故祖父的家。双亲因意外事故而丧生，变得无依无靠...\"\n    }\n  ]\n}\n```\n\n`title` 是番剧的标题，`cover` 是封面图链接， `des` 是简介，上述字段均根据需要修改。\n\n另外除了 `watchedExtra` 数组，还可以在后面添加新的数组，可用数组名如下:\n\n|可用数组名|含义|\n|-|-|\n|wantWatchExtra|想看|\n|watchingExtra|在看|\n|watchedExtra|看过|\n\n需要注意，在两个数组之间需要用 `,` 分隔。\n\n## 多主题兼容\n\n1. [Fork](https://github.com/HCLonely/hexo-bilibili-bangumi/fork)此项目并克隆到本地；\n2. 进入项目目录并安装依赖`npm install`;\n3. 在`src/lib/templates/theme/`目录内添加`主题.css`文件（例：`butterfly.css`）；\n4. 在`主题.css`文件内添加主题兼容样式表；\n5. 运行命令`npm run build`;\n6. 提交PR.\n\n## Lisense\n\n[Apache Licence 2.0](https://github.com/HCLonely/hexo-bilibili-bangumi/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHCLonely%2Fhexo-bilibili-bangumi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHCLonely%2Fhexo-bilibili-bangumi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHCLonely%2Fhexo-bilibili-bangumi/lists"}