![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 369
Karma: 37869
Join Date: Sep 2011
Device: Kobo eReader Touch, Kobo Aura HD
|
COPS : Calibre OPDS PHP Server
Hi,
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; 07-25-2013 at 07:58 AM. Reason: Add HTML |
![]() |
![]() |
![]() |
#2 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 369
Karma: 37869
Join Date: Sep 2011
Device: Kobo eReader Touch, Kobo Aura HD
|
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 : https://wiki.mobileread.com/wiki/OPDS Last edited by vlad59; 03-07-2012 at 12:33 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() Posts: 26
Karma: 10
Join Date: May 2011
Device: Nexus 7 (v1)
|
I just tried it with Moon+ Pro. Browsing works fine.
|
![]() |
![]() |
![]() |
#4 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 369
Karma: 37869
Join Date: Sep 2011
Device: Kobo eReader Touch, Kobo Aura HD
|
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: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
Stanza appears to be working fine.
|
![]() |
![]() |
Advert | |
|
![]() |
#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 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 369
Karma: 37869
Join Date: Sep 2011
Device: Kobo eReader Touch, Kobo Aura HD
|
@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 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 369
Karma: 37869
Join Date: Sep 2011
Device: Kobo eReader Touch, Kobo Aura HD
|
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 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 369
Karma: 37869
Join Date: Sep 2011
Device: Kobo eReader Touch, Kobo Aura HD
|
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 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 369
Karma: 37869
Join Date: Sep 2011
Device: Kobo eReader Touch, Kobo Aura HD
|
@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, dns, kobo aura, synology |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre OPDS server with windows apps? | nickdma | Related Tools | 10 | 03-03-2024 02:53 PM |
[Old Thread] Android FBreader and Calibre OPDS server question | kalex | Calibre | 5 | 12-24-2015 10:16 PM |
PHP+Apache web server for calibre ... | chaley | Related Tools | 254 | 04-28-2014 08:18 PM |
External OPDS catalogue in Calibre | bolton | Calibre | 1 | 09-05-2012 06:14 AM |
Calibre Command Line usage with PHP | artoros | Related Tools | 13 | 07-01-2010 09:57 AM |