以下の内容はhttps://phst.hateblo.jp/entry/2020/12/21/080000より取得しました。


漫画のEPUBファイルから画像をPythonで取得する方法

pypi.org

が便利だった。

pip install EbookLib でインストール

カバーebooklib.ITEM_COVERと、画像ebooklib.ITEM_IMAGEをそれぞれ開き、バイナリ形式で出力する。

import ebooklib
from ebooklib import epub
import os

book = epub.read_epub('filename.epub')

for image in book.get_items_of_type(ebooklib.ITEM_COVER):
    print(image.file_name,os.path.basename(image.file_name))

    with open(os.path.basename(image.file_name),"wb") as f:
        f.write(image.get_content())

for image in book.get_items_of_type(ebooklib.ITEM_IMAGE):
    print(image.file_name,os.path.basename(image.file_name))
    
    with open(os.path.basename(image.file_name),"wb") as f:
        f.write(image.get_content())



以上の内容はhttps://phst.hateblo.jp/entry/2020/12/21/080000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14