Skip to main content

即漫画阅读器

项目描述

即漫画查看器

检索和反混淆输入章节 ID 的漫画页面。漫画页面可以保存双展开图像以及单页图像。需要通过查看章节 url 从 Viz 站点检索章节 ID。

免责声明:我未获得 Viz Media 的许可或附属于,此存储库仅供参考。阅读后请删除检索到的页面。

安装

pip install viz_manga

用法

该类VizMangaDetails可用于查找系列和章节元数据,VizMangaFetch该类用于实际获取章节页面。

要获取所有公开可用的系列:

from viz_manga import VizMangaDetails, VizMangaFetch

details: VizMangaDetails = VizMangaDetails()
series: List[Series] = details.get_series()

要获得对一个系列公开免费的所有章节:

series: Series = Series(None, "one-piece")
details: VizMangaDetails = VizMangaDetails()
for chapter in details.get_series_chapters(series):
    if chapter.is_free:
        print(chapter)

获取章节的所有页面:

viz: VizMangaFetch = VizMangaFetch()
viz.save_chapter(24297, "images/", combine=True):

命令行使用

该模块与一个 CLI 脚本捆绑在一起viz-manga-cli,允许用户在不编写任何代码的情况下查找和获取章节。

usage: viz-manga-cli [-h] {fetch,series,chapters} ...

Lookup Viz manga information.

positional arguments:
  {fetch,series,chapters}
    fetch               Fetches and deobfuscates an entire manga chapter for reading.
    series              Get series title and slug (for chapter lookup) obtained from the Viz site.
    chapters            Get chapter title and id obtained from the Viz site.

options:
  -h, --help            show this help message and exit

查找漫画系列

>>> viz-manga-cli series

{'name': '7thGARDEN', 'slug': '7th-garden'}
{'name': 'Agravity Boys', 'slug': 'agravity-boys'}
{'name': 'Akane-banashi', 'slug': 'akane-banashi'}
{'name': "Akira Toriyama's Manga Theater", 'slug': 'akira-toriyamas-manga-theater'}
{'name': 'All You Need is Kill', 'slug': 'all-you-need-is-kill-manga'}
{'name': 'Assassination Classroom', 'slug': 'assassination-classroom'}

查找漫画章节

>>> viz-manga-cli chapters --help
usage: viz-manga-cli chapters [-h] [--free] series_slug

positional arguments:
  series_slug  Series title for which to lookup chapter ids from the Viz site.

options:
  -h, --help   show this help message and exit
  --free       Only show publicly available free chapters for the series.

>>> viz-manga-cli chapters 7th-garden

{'title': 'ch-1', 'id': '15220', 'link': 'https://www.viz.com/shonenjump/7th-garden-chapter-1/chapter/15220', 'is_free': True}
{'title': 'ch-2', 'id': '15221', 'link': 'https://www.viz.com/shonenjump/7th-garden-chapter-2/chapter/15221', 'is_free': True}
{'title': 'ch-3', 'id': '15222', 'link': 'https://www.viz.com/shonenjump/7th-garden-chapter-3/chapter/15222', 'is_free': True}
{'title': 'ch-4', 'id': '15223', 'link': 'https://www.viz.com/shonenjump/7th-garden-chapter-4/chapter/15223', 'is_free': False}
{'title': 'ch-5', 'id': '15224', 'link': 'https://www.viz.com/shonenjump/7th-garden-chapter-5/chapter/15224', 'is_free': False}

获取章节

>>> viz-manga-cli fetch --help
usage: viz-manga-cli fetch [-h] [--directory DIRECTORY] slug

positional arguments:
  slug                  Chapter id or series name obtained from the Viz site.

options:
  -h, --help            show this help message and exit
  --directory DIRECTORY
                        Output directory to save the deobfuscated pages.

>>> viz-manga-cli fetch 15220 --directory images/

INFO:root:Getting 79 pages for Root 1: The Demon's Servant
Successfully retrieved chapter 15220

从系列中获取所有免费章节

重要提示:仅供阅读,阅读后请删除。

如果为 指定了系列 slug fetch,它将尝试检索该系列的所有免费章节,将每个章节放入它自己的子目录中。如果该章的目录文件夹已存在,则 cli 将跳过该章。

>>> viz-manga-cli fetch one-piece --directory images/

INFO:root:Getting 18 pages for One Piece Chapter 1049.0
INFO:root:Successfully retrieved chapter ch-1049 at: images/ch-1049
INFO:root:Getting 18 pages for One Piece Chapter 1048.0
INFO:root:Successfully retrieved chapter ch-1048 at: images/ch-1048
INFO:root:Getting 20 pages for One Piece Chapter 1047.0
INFO:root:Successfully retrieved chapter ch-1047 at: images/ch-1047
INFO:root:Successfully retrieved chapter ch-3 at: images/ch-3
INFO:root:Getting 25 pages for Chapter 2: They Call Him “Straw Hat Luffy”
INFO:root:Successfully retrieved chapter ch-2 at: images/ch-2
INFO:root:Getting 55 pages for Chapter 1: Romance Dawn
INFO:root:Successfully retrieved chapter ch-1 at: images/ch-1

码头工人

>>> docker build -t viz-manga .
>>> docker run -v /home/user/images/:/app/images viz-manga fetch 24297 --directory images/

INFO:root:Getting 20 pages for One Piece Chapter 1047.0
Successfully retrieved chapter 24297

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

viz-manga-0.1.4.tar.gz (7.7 kB 查看哈希

已上传 source

内置分布

viz_manga-0.1.4-py3-none-any.whl (8.2 kB 查看哈希

已上传 py3