![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Sep 2018
Device: kindle3
|
![]()
Hi, I am trying to add my ebook to calibre content server by sending post request with python. And here is the code.
https://gist.github.com/Nriver/7b62d...97d16226d3da3a This worked and calibre server did get the new book. However, when I compare the ebook file in the calibre server and the original one, I found the file content is little bit wrong. The form information was on the top of the file. Please see the attachment image. If I upload it with Chrome manually, this won't happen. I am wondering whether there is something wrong with my code. I had read some of the calibre source code. In the cdb.py file, there is a line 'rd.request_body_file.seek(0)', could this be cause of the problem? Maybe the real file content should start with some offset? P.S. 'ctx' stands for context, and what is 'rd' stand for? I see them a lot in the server code. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,260
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Why not just use calibredb.exe, it can connect to a calibre server and add books, set metadata and do lots of other operations.
rd stands for RequestData |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Sep 2018
Device: kindle3
|
I am writing a crawler to generate ebook on a different server. So I think it would be better if I can add the book over the content server.
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,260
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yeah calibredb allows you to add the book over the server, it acts as a client connecting to the server.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to get book cover width and height in Calibre Python code? | datcha | Library Management | 3 | 02-11-2016 09:55 AM |
How To Add OPF Book To Calibre? | Vienna01 | Calibre | 7 | 08-28-2015 10:28 AM |
Python script to add scribble to pdf - teach me how to make into a plugin | cadmus | Plugins | 2 | 02-21-2012 02:03 PM |
Cannot add a book to Calibre | daithi81 | Calibre | 20 | 01-30-2010 10:01 PM |