shemanaev / inpxer

OPDS and web server for .inpx libraries with full-text search.
https://hub.docker.com/r/shemanaev/inpxer
MIT License
23 stars 0 forks source link

Cannot download converted epub-files #3

Closed leaf-avf closed 2 months ago

leaf-avf commented 10 months ago

Thanks for inpxer, awesome tool!

My issue is related to the fact that I cannot download converted files (in epub format).

I'm using fb2c converter Example of my config:

[[converters]]
## source file extension
from = "fb2"
## target file extension
to = "epub"
## converter executable
command = "/usr/local/fb2c/fb2c"
## converter arguments. {from} becomes source file path, {to} - output file path
arguments = "-c /usr/local/fb2c/configuration.toml convert {from} {to}"

Accordingly, to the log, the convertation process was finished with no errors

2024/01/23 10:44:08 Waiting for converter to finish. /usr/local/fb2c/fb2c -c /usr/local/fb2c/configuration.toml convert /tmp/book2677690644.fb2 /tmp/762341.epub
2024/01/23 10:44:16 "GET http://192.168.1.30:13308/download/762341/epub/ HTTP/1.1" from 192.168.1.24:57869 - 200 201B in 9.668320603s

but instead of epub-file, the downloaded file is a pretty XML file which contain something like this inside:

<pre>
<a href="book1031408075.epub">book1031408075.epub</a>
<a href="book3921421417.epub">book3921421417.epub</a>
</pre>

Note: as I can see, the epub-files are available (after convertation) in the /tmp/ Listing of /tmp/:

268839.epub:
book112911802.epub
book2314738211.epub

762341.epub:
book1031408075.epub
book3921421417.epub
Человек, который смеется.epub

So, the issue in my opinion is related to the wrong definition of the path to the converted path. Could you please fix it? Thanks in advance

shemanaev commented 10 months ago

Hi, I added workaround for fb2converter. It expects output directory instead of file name. Use new placeholder {to_dir} instead of {to}

leaf-avf commented 10 months ago

Hi,

Unfortunately still doesn't work :(

Two scenarios:

  1. When in toml specified: arguments = "-c /usr/local/fb2c/configuration.toml convert {from} {to_dir}" - getting 404
  2. When in toml specified: arguments = "-c /usr/local/fb2c/configuration.toml convert {from} {to}" - the same behaviour (getting XML file instead of epub)

P.S. Converted epub-files now available in /tmp (no subfolders in the path), while 404 error shows attempt to download from: http://192.168.1.30:13308/download/745476/epub

image

shemanaev commented 10 months ago

I can't reproduce this behavior. Can you share your .inpx?

пн, 29 янв. 2024 г., 15:37 leaf-avf @.***>:

Hi,

Unfortunately still doesn't work :(

Two scenarios:

  1. When in toml specified: arguments = "-c /usr/local/fb2c/configuration.toml convert {from} {to_dir}" - getting 404
  2. When in toml specified: arguments = "-c /usr/local/fb2c/configuration.toml convert {from} {to}" - the same behaviour (getting XML file instead of epub)

P.S. Converted epub-files now available in /tmp (no subfolders in the path), while 404 error shows attempt to download from: http://192.168.1.30:13308/download/745476/epub

image.png (view on web) https://github.com/shemanaev/inpxer/assets/54169743/18c5856f-1c95-48a9-8ce8-c537782188c6

— Reply to this email directly, view it on GitHub https://github.com/shemanaev/inpxer/issues/3#issuecomment-1914610662, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICN2JSLHR4OLZHZWIPPHLYQ6JX7AVCNFSM6AAAAABCGTODYWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJUGYYTANRWGI . You are receiving this because you commented.Message ID: @.***>

leaf-avf commented 10 months ago

Sure. https://leaf.line.pm:3001/sharing/sEhjwUr06

It's an inpx for this library: https://booktracker.org/viewtopic.php?t=1198

shemanaev commented 10 months ago

I still can't reproduce it, even with those files.

Added a little bit of logs in new version, maybe this will get a clue.

leaf-avf commented 10 months ago

@shemanaev

Checked last release - with no success :(

Here are my logs + config file: https://leaf.line.pm:3001/sharing/SFXjfqAhn

BTW, for me looks strange, that (accordingly to logs) process of convertation was called two times

Regards

shemanaev commented 10 months ago

BTW, for me looks strange, that (accordingly to logs) process of convertation was called two times

That looks like two different downloads, one after another. But still no clue.

Here's a build with different approach of file handling to test. inpxer_arm64.zip

leaf-avf commented 10 months ago

BTW, for me looks strange, that (accordingly to logs) process of convertation was called two times

That looks like two different downloads, one after another. But still no clue.

Here's a build with different approach of file handling to test. inpxer_arm64.zip

Could you please share a linux_amd64 version as well?

shemanaev commented 10 months ago

Sure inpxer_amd64.zip

leaf-avf commented 10 months ago

With this version I'm getting another errors :) File with id 649814 not found image

Accordingly to the log of fb2converter, now there was only 1 process of convertation

shemanaev commented 10 months ago

Does file /tmp/book1366648434.epub exists after conversion?

leaf-avf commented 10 months ago

Nope. Created epub file has name %title%.epub, where %title% is the name from metadata of original file (this behavior (name of output file) is configured via configuration.toml for fb2converter)

shemanaev commented 10 months ago

(this behavior (name of output file) is configured via configuration.toml for fb2converter)

Oh, that's why. Output file name must be the same as input except extension.

leaf-avf commented 10 months ago

I see. Will try to change configuration and repeat the process. I will update you later.

Thanks

leaf-avf commented 9 months ago

Oh, that's why. Output file name must be the same as input except extension.

Now it's working. Many thanks for your support!