Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Related Tools

Notices

Reply
 
Thread Tools Search this Thread
Old 03-02-2012, 04:26 PM   #1
vlad59
Addict
vlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five words
 
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 :
  • No need for many dependencies (aside from PHP).
  • No need for a lot of CPU or RAM.
  • Not much code.
  • Search is available.
  • With Dropbox it's very easy to have an always up to date OPDS server.
  • 100% OPDS valid code (checked with http://opds-validator.appspot.com/).
  • It was fun to code.

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 08:58 AM. Reason: Add HTML
vlad59 is offline   Reply With Quote
Old 03-03-2012, 04:37 PM   #2
vlad59
Addict
vlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five words
 
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 01:33 PM.
vlad59 is offline   Reply With Quote
Advert
Old 03-09-2012, 02:31 PM   #3
bobkoure
Enthusiast
bobkoure began at the beginning.
 
Posts: 27
Karma: 10
Join Date: May 2011
Device: Nexus 7 (v1)
I just tried it with Moon+ Pro. Browsing works fine.
bobkoure is offline   Reply With Quote
Old 03-10-2012, 05:58 AM   #4
vlad59
Addict
vlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five words
 
Posts: 369
Karma: 37869
Join Date: Sep 2011
Device: Kobo eReader Touch, Kobo Aura HD
Quote:
Originally Posted by bobkoure View Post
I just tried it with Moon+ Pro. Browsing works fine.
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.
vlad59 is offline   Reply With Quote
Old 03-10-2012, 12:54 PM   #5
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
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
Quote:
Originally Posted by vlad59 View Post
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.
Stanza appears to be working fine.
ilovejedd is offline   Reply With Quote
Advert
Old 04-02-2012, 03:36 PM   #6
CBebop
Junior Member
CBebop began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2012
Device: Kindle
Is there anything major that holds it back from supporting mobi formatted books?
CBebop is offline   Reply With Quote
Old 04-02-2012, 04:08 PM   #7
euterpe
Member
euterpe began at the beginning.
 
euterpe's Avatar
 
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:
Originally Posted by vlad59 View Post
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 :
  • No need for many dependencies (aside from PHP).
  • No need for a lot of CPU or RAM.
  • Not much code.
  • Search is available.
  • With Dropbox it's very easy to have an always up to date OPDS server.
  • 100% OPDS valid code (checked with http://opds-validator.appspot.com/).
  • It was fun to code.

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
euterpe is offline   Reply With Quote
Old 04-03-2012, 03:33 AM   #8
vlad59
Addict
vlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five words
 
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.
vlad59 is offline   Reply With Quote
Old 04-04-2012, 10:32 AM   #9
CBebop
Junior Member
CBebop began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2012
Device: Kindle
Quote:
Originally Posted by vlad59 View Post
@CBebop

No nothing major hold back mobi support (only my laziness). I'll work on it this weekend.
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.
CBebop is offline   Reply With Quote
Old 04-05-2012, 03:48 AM   #10
vlad59
Addict
vlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five words
 
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.
vlad59 is offline   Reply With Quote
Old 04-09-2012, 12:15 PM   #11
CBebop
Junior Member
CBebop began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2012
Device: Kindle
Quote:
Originally Posted by vlad59 View Post
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.
I would be more than willing to test if you need me to. If there is a better place to coordinate a test, let me know (AIM, IRC, <insertChatClient>).
CBebop is offline   Reply With Quote
Old 04-13-2012, 04:54 PM   #12
vlad59
Addict
vlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five words
 
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) :
  • Add support for MOBI and PDF
  • Major refactoring to prepare something nice for the future
  • Add a config item to make use of X-Sendfile instead of X-Accel-Redirect if needed

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.
vlad59 is offline   Reply With Quote
Old 04-14-2012, 04:27 AM   #13
gaspine
Member
gaspine began at the beginning.
 
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 06:42 AM.
gaspine is offline   Reply With Quote
Old 04-16-2012, 04:19 AM   #14
vlad59
Addict
vlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five wordsvlad59 can name that ebook in five words
 
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.
vlad59 is offline   Reply With Quote
Old 05-02-2012, 12:11 PM   #15
b1ackmai1er
Junior Member
b1ackmai1er began at the beginning.
 
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 11:04 AM.
b1ackmai1er is offline   Reply With Quote
Reply

Tags
calibre opds, dns, kobo aura, synology


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre OPDS server with windows apps? nickdma Related Tools 10 03-03-2024 03:53 PM
[Old Thread] Android FBreader and Calibre OPDS server question kalex Calibre 5 12-24-2015 11:16 PM
PHP+Apache web server for calibre ... chaley Related Tools 254 04-28-2014 09:18 PM
External OPDS catalogue in Calibre bolton Calibre 1 09-05-2012 07:14 AM
Calibre Command Line usage with PHP artoros Related Tools 13 07-01-2010 10:57 AM


All times are GMT -4. The time now is 07:04 AM.


MobileRead.com is a privately owned, operated and funded community.