Giter Site home page Giter Site logo

rupor-github / fb2converter Goto Github PK

View Code? Open in Web Editor NEW
259.0 6.0 18.0 42.04 MB

Unified converter of FB2 files into epub2, kepub, mobi and azw3 formats.

License: GNU General Public License v3.0

Shell 0.19% Go 95.35% CSS 4.47%
ebooks azw azw3 fb2 kindle-devices hyphens thumbnails eink-devices kepub kobo

fb2converter's People

Contributors

rupor-github avatar shemanaev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fb2converter's Issues

Where can I find the <transfer> function?

NAME:
fb2c.exe transfer - Prepares EPUB file(s) for transfer (Kindle only!)

Doesn't the new version written in Go support transfer commands?
Are there any plans to add this feature? Or where can I find and use this feature? Thanks.

fb2mobi: пользовательские настройки

Здравствуйте!

При использовании обертки fb2mobi (для MyHomeLib), независимо от наличия configuration.toml в директории fb2converter и/или в fb2mobi, fb2c.exe вызывается с дефолтными настройками (без -c параметра), например:

2020-10-20T17:36:06.252+0300	DEBUG	fb2converter/fb2c.go:91	Program started	{"args": ["D:\\MyHomeLib\\converters\\fb2converter\\fb2c.exe", "-mhl", "2", "convert", "--ow", "C:\\Users\\Alex\\AppData\\Local\\Temp\\_myhomelib\\01 - Трон из костей дракона.fb2", "C:\\Users\\Alex\\Desktop\\Уильямс Тэд\\Орден Манускрипта"], "ver": "1.54 (go1.15.3) : 753067013115c031dcd3d319634e64426a70e22e"}
2020-10-20T17:36:06.252+0300	INFO	fb2converter/fb2c.go:93	Using defaults (no configuration file)

Эта стало для меня проблемой, когда я захотел использовать механизм самого MHL для изменения заголовка fb2 (в моем случае я поставил шаблон [%s [#%n ]- ]%t): не всегда заголовок, и особенно серия в тегах файлов fb2, совпадает с информацией из inpx коллекции. После этого я стал получать заголовки типа:

2020-10-20T17:36:06.688+0300	DEBUG	processor/mobiazw3.go:173	Info:I9006:option: -c1: Standard DOC compression
2020-10-20T17:36:06.709+0300	DEBUG	processor/mobiazw3.go:173	Info(prcgen):I1047: Added metadata dc:Title        "(ОМ - 01) Орден Манускрипта #01 - Трон из костей дракона"

В итоге я просто отредактировал config/cfg.go и пересобрал fb2converter, что несложно, но пересобирать каждый раз, когда хочешь поменять настройки, как-то не очень удобно. Может быть, есть более "цивилизованный" способ? Если нет, было бы удобно при вызове fb2mobi.exe проверять на наличие конфигурационного файла в одной с ним директории и считывать его, если он найден.

Спасибо 😃

P.S. Думаю, все сказанное также относится и к обертке fb2epub

GoodReads integration

Add an ability to pass proper ASIN (and may be ISBN), probably using "overwrite metadata" mechanism. This may be useful for Kindle, which has GoodReads integration "out of the box". At the moment it is not clear if epub/kepub formats need something like that too. Make sure new info is used in the resulting binary.

Не отображается обложка книги в Kindle Paperwhite 2018

Здравствуйте!

Для начала, огромное спасибо за ваш труд!

Есть одна проблема. На руках Kindle Paperwhite 2018. Прошивка 5.12.1 оригинальная без каких-либо изменений.

Есть такая книга в формате FB2: 43607480.zip

Отсылаю ее на устройство с помощью libro 0.8.

В программе обложка отображается, на устройстве же - нет.
image

Буду крайне признателен, если получится решить проблему! Спасибо!

multiseries support

I'm often stumble upon books which have multiple series sequence tags like in this example:

<?xml version="1.0" encoding="UTF-8"?>
<FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0" xmlns:l="http://www.w3.org/1999/xlink">
<description>
  <title-info>
    [...]
    <sequence name="Main Series Name"/>
    <sequence name="Sub Series Name" number="1"/>
  </title-info>
</description>

Currently fb2converter only looks for the first one and ignores all subsequent sequences. So it losing not only more relevant subseries name but more importantly book number in the series. Are there any plans to support that?

I'm hacked around the problem like this:

--- a/processor/process.go
+++ b/processor/process.go
@@ -672,9 +672,14 @@ func (p *Processor) processDescription() error {
                                        p.Book.Authors = append(p.Book.Authors, an)
                                }
                        }
-                       if e := info.SelectElement("sequence"); e != nil {
+                       for _, e := range info.SelectElements("sequence") {
                                var err error
-                               p.Book.SeqName = getAttrValue(e, "name")
+                               name := getAttrValue(e, "name")
+                               if name == "" {
+                                       p.env.Log.Warn("Sequence name is not defined", zap.String("xml", getXMLFragmentFromElement(e)))
+                                       continue
+                               }
+                               p.Book.SeqName = filepath.Join(p.Book.SeqName, name)
                                num := getAttrValue(e, "number")
                                if len(num) > 0 {
                                        if !govalidator.IsNumeric(num) {

But that's obviously a dirty hack and Book.SeqName/Book.SeqNum needs to be replaced with array like Book.Authors to cleanly support that. Maybe with some additional configuration parameters determining how to deal with them.

fb2mobi.exe only accept 1 directory deep output path

When using fb2mobi wrapper, then output directory cut. In my example, I'm passing "Z:\BookExport_MOBI_EXPORT" as target directory, but fb2c receive only "Z:\BookExport". See output below:

E:\Books\converters\fb2mobi>fb2mobi.exe "C:\Users\STSARE1\AppData\Local\Temp_myhomelib\01 - Agent na myagkih lapah.fb2" "Z:\BookExport_MOBI_EXPORT"
Starting E:\Books\converters\fb2converter\fb2c.exe with ["-mhl" "2" "convert" "--ow" "C:\Users\STSARE
1\AppData\Loca
l\Temp\myhomelib\01 - Agent na myagkih lapah.fb2" "Z:\BookExport"]
2020-12-30T10:31:54.023+0100 INFO Using defaults (no configuration file)
2020-12-30T10:31:54.024+0100 INFO Processing starting {"source": "C:\Users\STSARE~1\AppData\Local\Temp\

myhomelib\01 - Agent na myagkih lapah.fb2", "destination": "Z:\BookExport", "format": "mobi"}
2020-12-30T10:31:54.024+0100 INFO Conversion starting {"from": "01 - Agent na myagkih lapah.fb2"}
2020-12-30T10:31:54.306+0100 WARN Removing cover image duplicates, leaving only the first one
2020-12-30T10:31:57.325+0100 WARN Overwriting existing file {"file": "Z:\BookExport\01 - Agent na myagkih
lapah.mobi"}
2020-12-30T10:31:57.459+0100 INFO Conversion completed {"elapsed": "3.4352107s", "to": "Z:\BookExport\01 - Ag
ent na myagkih lapah.mobi"}
2020-12-30T10:31:57.459+0100 INFO Processing completed {"elapsed": "3.4352107s"}

Support for Kindle Scribe

Scribe of course uses MTP (media transfer protocol). Calibre currently does not support copying thumbnails for it.

There are some C libraries (check calibre source code for example), perhaps you could call those from Go.

Интеграция с GoodReads

Привет!

При конвертации из fb2 в mobi теряется часть информации, которая хранится в структуре FB2.

Вот так выглядит метадата в Calibre после конвертации через fb2conv из fb2 в mobi:

Screenshot 2019-12-03 at 10 57 29

А вот так она выглядит после конвертации через встроенный конвертор Calibre:

Screenshot 2019-12-03 at 11 03 31

А волнует меня это только по той причине, что файл сконвертированный в Calibre с корректно проставленным asin (я подозреваю в этом дело) может нормально работать с сервисом Goodreads при попадании в Kindle. Весьма полезная фича.

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.