|
|
#1 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 185
Karma: 9088
Join Date: Sep 2011
Device: Kobo eReader Touch
|
COPS : Calibre OPDS and HTML PHP Server
I know that Calibre include a powerful server which can provide HTML and OPDS. But my goal was to host my OPDS server on a small server with limited RAM and CPU (it could also be a VPS). That's why I coded COPS. It's main advantages are :
It's still in early stages but it works enough for me. In any cases I'm open to suggestions to enhance it. You can download it here : http://blog.slucas.fr/en/oss/calibre-opds-php-server Last edited by vlad59; 03-06-2013 at 09:07 AM. Reason: Add HTML |
|
|
|
|
|
#2 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 185
Karma: 9088
Join Date: Sep 2011
Device: Kobo eReader Touch
|
For those who would like to test it, i put up a demo catalog (with some public domain books) here :
http://cops-demo.slucas.fr/feed.php Please tell if it works or not especially if you're not using FBReader or Aldiko (I already know these two are working fine). You have to use an OPDS client to check the demo (a normal browser or feed reader won't do). A list of OPDS client is here : http://wiki.mobileread.com/wiki/OPDS Last edited by vlad59; 03-07-2012 at 12:33 PM. |
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Junior Member
![]() Posts: 5
Karma: 10
Join Date: May 2011
Device: viewsonic g-tablet
|
I just tried it with Moon+ Pro. Browsing works fine.
|
|
|
|
|
|
#4 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 185
Karma: 9088
Join Date: Sep 2011
Device: Kobo eReader Touch
|
Thanks a lot for the report.
I would like some report of stanza / megareader users as I remember there was some compatibility problem some time ago. I've seen some visit in the logs from those OPDS client but I can't be sure if it was working or not. |
|
|
|
|
|
#5 |
|
hopeless n00b
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,106
Karma: 4988742
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PRS-350, Nexus S, Galaxy S, Nook Color, iPhone4, iPT4, iPad 2012
|
Stanza appears to be working fine.
__________________
Dropbox - Always have your stuff, wherever you are. (+500MB bonus for us both if you sign up via this link) |
|
|
|
|
|
#6 |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Apr 2012
Device: Kindle
|
Is there anything major that holds it back from supporting mobi formatted books?
|
|
|
|
|
|
#7 | |
|
Member
![]() Posts: 10
Karma: 10
Join Date: Feb 2012
Device: Kindle Fire
|
hi, im making a catalog as we speak and searched opds and came up with this thread.
I'm using my Dropbox account -- is this script an alternative to dropbox? Thanks looks cool Euterpe Quote:
|
|
|
|
|
|
|
#8 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 185
Karma: 9088
Join Date: Sep 2011
Device: Kobo eReader Touch
|
@CBebop
No nothing major hold back mobi support (only my laziness). I'll work on it this weekend. @euterpe From my point of view it's not an alternative to Dropbox as I use it with dropbox. I have a laptop with Calibre and my Calibre library is located in my dropbox folder. I have a VPS with Dropbox and COPS installed. So each time I make a modification on my laptop's calibre library it's automatically synchronized onto my VPS (thanks to Dropbox) and my OPDS catalog is always up to date without having to do any manual stuff (as it reads directly from the Calibre database). I hope it's clearer. |
|
|
|
|
|
#9 |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Apr 2012
Device: Kindle
|
That would be awesome. I was honestly going to try to hack it in for myself if it wasn't much trouble (I have not been able to look at the code just yet). While we are on the subject of the code itself, what portions are specific to nginx? I am a big user of lighttpd and if it were functions I would be able to replace to support lighttpd that would keep me from having to rebuild a VSP to use this.
|
|
|
|
|
|
#10 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 185
Karma: 9088
Join Date: Sep 2011
Device: Kobo eReader Touch
|
The only nginx specific code is the use of the header X-Accel-Redirect to handle the download of files outside your web directory.
I believe that lighttpd has almost the same feature with x-sendfile (I'll let you google it if needed) so it shouldn't be hard to add (3-5 line change) assuming you're willing to test. |
|
|
|
|
|
#11 | |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Apr 2012
Device: Kindle
|
Quote:
|
|
|
|
|
|
|
#12 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 185
Karma: 9088
Join Date: Sep 2011
Device: Kobo eReader Touch
|
COPS 0.0.2 is out with the following changes (First post to download) :
I've updated the demo to add a .Mobi and a .PDF to the book Alice in Wonderland. I have no access to any OPDS client that can download .Mobi but Mantano show the PDF correctly. Happy testing. @CBebop : I'll find some time next week to help you test COPS on lighttpd. |
|
|
|
|
|
#13 |
|
Member
![]() Posts: 15
Karma: 12
Join Date: Apr 2012
Device: ipad
|
Love cops, thanks for the great work.
i'm working on the opposite side of cops, making the library. I'm in the process of making a script who scan a directory with pub file and create / update the calibre database sqlite3 file and create the cover / metadata. The ultimate goal si to use my NAS to organise my epub book, juste put the .epub file in a ftp directory, a script scan the new file and organise them. i've a problem open the calibre sqlite 3 file, he say me "function XX" not found, did you have the same ? Thanks anyway Ps : i test it on my ipad / apache you have miss the forget : const PAGE_OPENSEARCH_QUERY = "9"; in OPDS_renderer.php Last edited by gaspine; 04-14-2012 at 05:42 AM. |
|
|
|
|
|
#14 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 185
Karma: 9088
Join Date: Sep 2011
Device: Kobo eReader Touch
|
@gaspine
Thanks for the error report, I fixed it yesterday. I'll publish a new release in 2 or 3 days. I had no problem opening Calibre database with sqlite3 on Linux or sqliteadmin on Windows or with PHP. Maybe I can help you if give more information by mail or PM. |
|
|
|
|
|
#15 |
|
Junior Member
![]() Posts: 2
Karma: 10
Join Date: May 2012
Device: Xoom
|
Request for assistance installing COPS
Hi Guys,
Anyone able to assist with the install on this? I have installed fastcgi, php5 and nginx and the COPS files and updated the nginx.conf and config_local.php configuration but received "Error 502 Bad gateway" messages when I load the site. The error log reports: connect to unix:/tmp/fcgi.sock failed (2: No such file or directory) The nginx.conf files refers to this directory in the line: fastcgi_pass unix:/tmp/fcgi.sock; So I change this to fastcgi_pass 127.0.0.1:9000; But the I received the error: [error] 4215#0: *1 upstream sent unsupported FastCGI protocol version: 72 while reading response header from upstream, client: 192.168.2.14, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "box" So I worked out I had to run fastcgi: php-cgi -b 127.0.0.1:9000 But now I get the following error: XML Parsing Error: syntax error Location: http://box/ Line Number 1, Column 1:exception 'PDOException' with message 'could not find driver' in /usr/local/html/base.php:223 At this stage I am lost. The COPS files are stored in /usr/local/html/ including the base.php file. Edit 1: I realize now the XML error is generated by my web browser. The actual page source lists the errors: exception 'PDOException' with message 'could not find driver' in /usr/local/html/base.php:223 Stack trace: #0 /usr/local/html/base.php(223): PDO->__construct('sqlite:/usr/loc...') #1 /usr/local/html/author.php(33): Base::getDb() #2 /usr/local/html/base.php(123): Author::getCount() #3 /usr/local/html/feed.php(30): Page->InitializeContent() #4 {main}exception 'PDOException' with message 'could not find driver' in /usr/local/html/base.php:223 Stack trace: #0 /usr/local/html/base.php(223): PDO->__construct('sqlite:/usr/loc...') #1 /usr/local/html/author.php(33): Base::getDb() #2 /usr/local/html/base.php(123): Author::getCount() #3 /usr/local/html/feed.php(30): Page->InitializeContent() #4 {main} Edit 2: I made some further progress - php.ini needed the pdosqlite extension added: extension=pdo_sqlite.so Unfortunately, I now get the error: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so: undefined symbol: sqlite3_libversion in Unknown on line 0 It seems my PHP5 is compiled for the wrong sqlite version ??? from phpinfo() SQLITE SQLite support enabled PECL Module version 2.0-dev $Id: sqlite.c 306939 2011-01-01 02:19:59Z felipe $ SQLite Library 2.8.17 SQLite Encoding iso8859 PDO PDO support enabled PDO drivers odbc, sqlite2 A bit confused at this stage as the sqlite library is sqlite3.so usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so usr/local/lib/php/extensions/no-debug-non-zts-20090626/sqlite3.so Can anyone help? Thanks. Last edited by b1ackmai1er; 05-03-2012 at 10:04 AM. |
|
|
|
![]() |
| Tags |
| calibre opds |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP+Apache web server for calibre ... | chaley | Related Tools | 251 | 01-04-2013 05:15 AM |
| [Old Thread] Android FBreader and Calibre OPDS server question | kalex | Calibre | 4 | 12-15-2012 01:50 PM |
| External OPDS catalogue in Calibre | bolton | Calibre | 1 | 09-05-2012 06:14 AM |
| Calibre OPDS server with windows apps? | nickdma | Related Tools | 9 | 02-02-2011 03:09 PM |
| Calibre Command Line usage with PHP | artoros | Related Tools | 13 | 07-01-2010 09:57 AM |