Skip to content

Instantly share code, notes, and snippets.

@junk-labs
Created October 21, 2021 02:07
Show Gist options
  • Save junk-labs/911e5f48b7766e42d3837064beb120ec to your computer and use it in GitHub Desktop.
Save junk-labs/911e5f48b7766e42d3837064beb120ec to your computer and use it in GitHub Desktop.
画像で構成された電子書籍をばらしてzip(無圧縮リカバリーレコード付きrar)に変換するスクリプト
@echo off
set Calibre_HOME=D:\Tool\Calibre
set RAR_HOME=C:\Program Files\WinRAR
path %path%;%Calibre_HOME%;%RAR_HOME%;%~dp0%
for %%f in (in\*.*) do (
title 変換中 %%~nf
if /i "%%~xf"==".azw" (ebook-convert "%%f" "%~dp0%%~nf")
if /i "%%~xf"==".azw3" (ebook-convert "%%f" "%~dp0%%~nf")
if /i "%%~xf"==".epub" (7za x "%%f" -o"%~dp0%%~nf")
rar a -m0 -rr3 -ep "%~dp0out\%%~nf.cbr" "%~dp0%%~nf\images\*" "%~dp0%%~nf\item\image\*" "%~dp0%%~nf\OEBPS\image\*" "%~dp0%%~nf\OPS\images\*"
rmdir /s /q "%~dp0%%~nf"
del "%%f"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment