Giter Site home page Giter Site logo

bangumikomga's Introduction

Bangumi metadata scraper for Komga

Introduction

This Script gets a list of every manga available on your Komga instance, looks it up one after another on Bangumi and gets the metadata for the specific series. This metadata then gets converted to be compatible to Komga and then gets sent to the server instance and added to the manga entry.

sample detail

Features

已完成

  • 漫画系列添加元数据
  • 单册漫画添加元数据
  • 自动跳过已刷新元数据的条目
  • 优先使用手动配置的bangumi链接(cbl)
  • 配置Bangumi登录
  • 同步观看进度至Bangumi
  • 可选择处理范围:①所有书籍系列;②指定库的书籍系列;③指定收藏的书籍系列
  • 区分单册和单话👉未匹配的书也会重新排序
  • 添加同人志👉推荐使用LANraragi

处理逻辑见DESIGN

TODO

Requirements

  • A Komga instance with access to the admin account
  • Either Windows/Linux/MAc or alternatively Docker
  • Python installed if using Windows, Linux or Mac natively

刷新元数据

  1. Install the requirements using

    conda install --file env_conda.txt
    
    pip install -r env_pip.txt
  2. Rename config.template.py to config.py and edit the url, email and password to match the ones of your komga instance (User needs to have permission to edit the metadata).

    BANGUMI_ACCESS_TOKEN (选填)用于读取NSFW条目,在 https://next.bgm.tv/demo/access-token 创建个人令牌

    cbl(Correct Bgm Link) 在系列元数据的链接中填入cbl和该漫画系列的bangumi地址即可。未刷新或强制刷新的漫画系列将优先使用此链接。建议搭配FORCE_REFRESH_LIST使用,从而修正元数据错误的书籍系列。也可以单独使用,为刷新失败的系列手动匹配

    FORCE_REFRESH_LIST 强制刷新的书籍系列,避免自动跳过。komga界面点击书籍系列(对应链接)即可获得,形如:'0B79XX3NP97K9'。填写时以英文引号''包裹,英文逗号,分割。建议搭配cbl(Correct Bgm Link)使用

    KOMGA_LIBRARY_LIST 处理指定库中的书籍系列。komga界面点击库(对应链接)即可获得,形如:'0B79XX3NP97K9'。填写时以英文引号''包裹,英文逗号,分割。与KOMGA_COLLECTION_LIST不能同时使用

    KOMGA_COLLECTION_LIST 处理指定收藏中的书籍系列。komga界面点击收藏(对应链接)即可获得,形如:'0B79XX3NP97K9'。填写时以英文引号''包裹,英文逗号,分割。与KOMGA_LIBRARY_LIST不能同时使用

     可以搭配`同步阅读进度`实现仅同步部分书籍系列的进度
    
  3. Run the script using python refreshMetadata.py 注意:会自动跳过已处理的系列及书

Tips:

如果无需刷新已失败的系列:

  • 可自行将upsert_series_record0修改为1
  • 或者自行修改数据库

如果漫画系列数量上千,请考虑使用bangumi/Archive离线数据代替联网查询

同步阅读进度

注意:当前仅为komga至bangumi单向同步

同步内容:

  • 仅同步卷数,不同步话数
  1. 步骤同刷新元数据

  2. 步骤同刷新元数据

    注意:

    • 如果配置了FORCE_REFRESH_LIST,则仅同步此列表配置的漫画系列进度
    • 如果未配置FORCE_REFRESH_LIST,则同步当前获取的所有系列的漫画进度(当前有3种范围:所有、仅指定库、仅指定收藏)。为避免污染时间线,请谨慎操作
  3. python updateReadProgress.py

Tips:

推荐使用Tachiyomi更新阅读进度👉Tracking | Tachiyomi

命名建议

[漫画名称][作者][出版社][卷数][其他1][其他2]

  • [漫画名称]:以漫画封面实际名称为准,繁体不必转简体。

  • [作者]:作者名字亦以单行本所给名字为准

    • 繁体不转为简体,若有日文假名亦保留,如[島崎讓]、[天王寺きつね];
    • 若作者为多人,则以×&符号连接各作者(注意:不是英文x),将作画作者列于最后,如[矢立肇×有贺ヒトシ]、[手塚治虫×浦沢直树]、[堀田由美×小畑健]。
  • [出版社]:例如[玉皇朝]、[青文]。

  • [卷数]:例如[Vol.01-Vol.12]。

  • [其他1]、[其他2]:其他信息。例如[完结]、[来源]。

例如:

[碧蓝之海][井上堅二×吉岡公威][Vol.01-Vol.18]
[相合之物][浅野伦][Vol.01-Vol.13]
[海王但丁][皆川亮二×泉福朗][Vol.01-Vol.13][境外版]

命名建议修改自某喵

Issues & Pull Requests

欢迎提交新规则、问题、功能……

致谢

本项目部分代码及思路来自Pfuenzle/AnisearchKomga,部分代码生成自chatgpt,在此表示感谢!

语料库数据来源,感谢公开:

另外,也感谢以下优秀项目:

bangumikomga's People

Contributors

chu-shen avatar pfuenzle avatar vinnpinn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.