Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

对convert-ebook的建议 #1

Open
Sipoon opened this issue Sep 22, 2020 · 6 comments
Open

对convert-ebook的建议 #1

Sipoon opened this issue Sep 22, 2020 · 6 comments

Comments

@Sipoon
Copy link

Sipoon commented Sep 22, 2020

我发现有部分书kindleunpack不能转换,用kindlegen可以转换的情况,可以尝试加一个判断,kindleunpack失败的话,用kindlegen继续转epub,当然也有这两个都转换失败的时候,再想办法吧。
还有我不需要继续转mobi,可以的话,增加一个提示,是否继续转换mobi,否就退出。

@jianyun8023
Copy link
Owner

可以的,我现在发现了一个转换器,比这两种方案更好用一些,但是api很难用。你可以试试,ecore

我封装的转换脚本

#!/bin/bash

format=$1
cd "$2"
DIR=$(pwd)
book_convert(){
    filepath=$1
    format=$2
    tmp_dir="$HOME/Downloads/eCoreCmdtmp/$(uuidgen)"
    mkdir -p $tmp_dir
    # rm -rf "$HOME/Downloads/eCoreCmdtmp"
    dirname=$(dirname "$filepath")
    basename=$(basename --s .azw3 "$filepath")
    origin_name=$(basename "$filepath")
    newfile_neme=$basename"."$format
    echo "- 转换 $basename$format"
    echo "$HOME/software/user_bin/eCoreCmd c $dirname/$origin_name $dirname/$newfile_neme $tmp_dir"
    $HOME/software/user_bin/eCoreCmd c "$dirname/$origin_name" "$dirname/$newfile_neme" "$tmp_dir"
    rm -rf $tmp_dir
    echo "- 已处理 $origin_name"
}

export -f book_convert

ls *.azw3 | xargs -I{} bash -c "book_convert '$DIR/{}' $format"

@Sipoon
Copy link
Author

Sipoon commented Sep 22, 2020

ecore我用过,转出来没封面页,有时甚至整本书全在一个html文件里,扎心了。

@Sipoon
Copy link
Author

Sipoon commented Sep 23, 2020

抱歉,我昨天说有些书kindleunpack不能转换,其实是我C盘满了导致的,都是能转换的,很好的软件,期待后续更新

@jianyun8023
Copy link
Owner

哈哈,没事。ecore我用着还可以。我是从他的电子书管理器里面提取出来的,版本会更新一些😀。

@Sipoon
Copy link
Author

Sipoon commented Sep 23, 2020 via email

@Sipoon
Copy link
Author

Sipoon commented Sep 30, 2020

好惨,C盘经常原地爆炸。。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants