Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot download converted epub-files #3

Open
leaf-avf opened this issue Jan 23, 2024 · 15 comments
Open

Cannot download converted epub-files #3

leaf-avf opened this issue Jan 23, 2024 · 15 comments

Comments

@leaf-avf
Copy link

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
Copy link
Owner

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

@leaf-avf
Copy link
Author

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
Copy link
Owner

shemanaev commented Jan 30, 2024 via email

@leaf-avf
Copy link
Author

@shemanaev
Copy link
Owner

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
Copy link
Author

@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
Copy link
Owner

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
Copy link
Author

leaf-avf commented Feb 2, 2024

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
Copy link
Owner

Sure
inpxer_amd64.zip

@leaf-avf
Copy link
Author

leaf-avf commented Feb 2, 2024

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
Copy link
Owner

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

@leaf-avf
Copy link
Author

leaf-avf commented Feb 2, 2024

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
Copy link
Owner

(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
Copy link
Author

leaf-avf commented Feb 2, 2024

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

Thanks

@leaf-avf
Copy link
Author

leaf-avf commented Feb 5, 2024

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

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

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

No branches or pull requests

2 participants