GithubHelp home page GithubHelp logo
calibre-web

janeczku / calibre-web Goto Github PK

View Code? Open in 1sVSCode Editor NEW
6.9K 163.0 901.0 75.38 MB

:books: Web app for browsing, reading and downloading eBooks stored in a Calibre database

License: GNU General Public License v3.0

Python 36.27% CSS 1.02% JavaScript 46.43% HTML 16.28%
calibre epub mobi ebook ebook-manager

calibre-web's Introduction

About

Calibre-Web is a web app providing a clean interface for browsing, reading and downloading eBooks using a valid Calibre database.

GitHub License GitHub commit activity GitHub all releases PyPI PyPI - Downloads Discord

This software is a fork of library and licensed under the GPL v3 License.

Main screen

Features

  • Bootstrap 3 HTML5 interface
  • full graphical setup
  • User management with fine-grained per-user permissions
  • Admin interface
  • User Interface in brazilian, czech, dutch, english, finnish, french, german, greek, hungarian, italian, japanese, khmer, korean, polish, russian, simplified and traditional chinese, spanish, swedish, turkish, ukrainian
  • OPDS feed for eBook reader apps
  • Filter and search by titles, authors, tags, series, book format and language
  • Create a custom book collection (shelves)
  • Support for editing eBook metadata and deleting eBooks from Calibre library
  • Support for downloading eBook metadata from various sources, sources can be extended via external plugins
  • Support for converting eBooks through Calibre binaries
  • Restrict eBook download to logged-in users
  • Support for public user registration
  • Send eBooks to E-Readers with the click of a button
  • Sync your Kobo devices through Calibre-Web with your Calibre library
  • Support for reading eBooks directly in the browser (.txt, .epub, .pdf, .cbr, .cbt, .cbz, .djvu)
  • Upload new books in many formats, including audio formats (.mp3, .m4a, .m4b)
  • Support for Calibre Custom Columns
  • Ability to hide content based on categories and Custom Column content per user
  • Self-update capability
  • "Magic Link" login to make it easy to log on eReaders
  • Login via LDAP, google/github oauth and via proxy authentication

Installation

Installation via pip (recommended)

  1. To avoid problems with already installed python dependencies, it's recommended to create a virtual environment for Calibre-Web
  2. Install Calibre-Web via pip with the command pip install calibreweb (Depending on your OS and or distro the command could also be pip3).
  3. Optional features can also be installed via pip, please refer to this page for details
  4. Calibre-Web can be started afterwards by typing cps

In the Wiki there are also examples for: a manual installation, installation on Linux Mint, installation on a Cloud Provider.

Quick start

Point your browser to http://localhost:8083 or http://localhost:8083/opds for the OPDS catalog
Login with default admin login
Set Location of Calibre database to the path of the folder where your Calibre library (metadata.db) lives, push "submit" button
Optionally a Google Drive can be used to host the calibre library -> Using Google Drive integration
Afterwards you can configure your Calibre-Web instance (Basic Configuration and UI Configuration on admin page)

Default admin login:

Username: admin
Password: admin123

Requirements

python 3.5+

Optionally, to enable on-the-fly conversion from one ebook format to another when using the send-to-ereader feature, or during editing of ebooks metadata:

Download and install the Calibre desktop program for your platform and enter the folder including program name (normally /opt/calibre/ebook-convert, or C:\Program Files\calibre\ebook-convert.exe) in the field "calibre's converter tool" on the setup page.

Download Kepubify tool for your platform and place the binary starting with kepubify in Linux: /opt/kepubify Windows: C:\Program Files\kepubify.

Docker Images

A pre-built Docker image is available in these Docker Hub repository (maintained by the LinuxServer team):

LinuxServer - x64, armhf, aarch64

  • Docker Hub - https://hub.docker.com/r/linuxserver/calibre-web

  • Github - https://github.com/linuxserver/docker-calibre-web

  • Github - (Optional Calibre layer) - https://github.com/linuxserver/docker-calibre-web/tree/calibre

    This image has the option to pull in an extra docker manifest layer to include the Calibre ebook-convert binary. Just include the environmental variable DOCKER_MODS=linuxserver/calibre-web:calibre in your docker run/docker compose file. (x64 only)

    If you do not need this functionality then this can be omitted, keeping the image as lightweight as possible.

    Both the Calibre-Web and Calibre-Mod images are rebuilt automatically on new releases of Calibre-Web and Calibre respectively, and on updates to any included base image packages on a weekly basis if required.

    • The "path to convertertool" should be set to /usr/bin/ebook-convert
    • The "path to unrar" should be set to /usr/bin/unrar

Contact

Just reach us out on Discord

For further information, How To's and FAQ please check the Wiki

Contributing to Calibre-Web

Please have a look at our Contributing Guidelines

calibre-web's People

Contributors

OzzieIsaacs avatar cbartondock avatar cervinko avatar idalin avatar jkrehm avatar shavitmichael avatar hexeth avatar blitzmann avatar mmonkey avatar bodybybuddha avatar ElQuimm avatar jvoisin avatar Krakinou avatar radoslawkierznowski avatar xlivevil avatar ghighi3f avatar pwr avatar ok11 avatar Yamakuni avatar Kyosfonica avatar otapi avatar nykul avatar leram84 avatar andy29485 avatar XZVB12 avatar celogeek avatar Knepherbird avatar aroberts avatar 89jd avatar lemmsh avatar

Stargazers

Hyunsung Lee avatar Sesame avatar  avatar Harold澂冰 avatar zooter_z avatar Chlorine2 avatar Huaqi Fang avatar SChenga avatar Elli0t avatar Dongze Li avatar JasonChung avatar Ricardo Fuhrmann avatar Zhengyi ZHUO avatar  avatar  avatar  avatar  avatar smile avatar  avatar 李唯聪 avatar  avatar  avatar Adu avatar Müslüm Barış Korkmazer avatar Kozumi avatar  avatar ywzheng avatar Jseanj avatar  avatar Roxiun avatar Jamie Sinn avatar Limour avatar  avatar zjw57 avatar silentlight avatar Benature Wong avatar Maxwell White avatar  avatar 上帝so疯狂 avatar chris avatar  avatar Marvin avatar zhangningwei avatar Timothy Colbert avatar Fari avatar ninvfeng avatar NicodeLee avatar Cold Cat avatar  avatar NunChan avatar QI Jianpeng avatar  avatar  avatar 章大猫 avatar CquMarz avatar 邢延恺 avatar Dmitry Sichkar avatar mapix avatar  avatar liaouser avatar asylm avatar Bronson Mendonca avatar  avatar Haoyu Wang avatar Liang avatar  avatar  avatar  avatar  avatar  avatar Sanjo Heron IT Hub avatar 白了个白 avatar Shane Cooke avatar 坤子 avatar  avatar 木逸辰 avatar 阿男 avatar xiaotian avatar XiaoLi avatar  avatar  avatar Molasses avatar  avatar  avatar jason.cheng avatar Lukas avatar  avatar Shijie Yao avatar  avatar Leo sun avatar  avatar Figo Xue avatar KevinL avatar Banhave avatar Sebastian Pincheira avatar  avatar Jack Arrington avatar 小菜鸟 avatar qingjiegong avatar 勐萌 avatar

Watchers

 avatar  avatar dervn avatar Adek Lanin avatar cntoby avatar vince8x avatar xuhaixiang avatar  avatar Alif avatar Zhu Xiaopeng avatar Chris Routh avatar Toshaan Bharvani avatar James Cloos avatar  avatar  avatar Patrick avatar Dorin avatar  avatar Get your own 'tots. Geez! avatar  avatar Ryan McCool avatar fprint avatar Etienne avatar Dmitry_V_Kostylev avatar  avatar  avatar  avatar Sandor Takacs avatar  avatar Aaron Labiosa avatar Edson C. Souza avatar  avatar  avatar Yuriy Evdokimov avatar Sprk-nl avatar  avatar  avatar Evangelos (Vagelis) Fragkos avatar Mohammed Al Sahaf avatar Dan Schaper avatar Ruben Bermudez avatar  avatar  avatar  avatar chbmb avatar Wei Zhou avatar  avatar Rafael Roa avatar Jan B avatar gema-arta avatar Kerwin Chou avatar Roger.wang avatar  avatar ahweb avatar Lee avatar  avatar  avatar dandelions avatar RealForce1024 avatar ericse avatar kevinhuang avatar steve wu avatar cppfish avatar  avatar Udo Hartmann avatar  avatar  avatar Ozzie Isaacs avatar  avatar  avatar 1701D avatar Sabar Suwarsono avatar caocao485 avatar  avatar Sunil Choudhary avatar Alex Viscreanu avatar Yassine Farich  avatar  avatar  avatar  avatar stormyep avatar Chris Kolan avatar Luis Gustavo avatar  avatar XiaoLin Hu avatar Sihan avatar  avatar blackjack90 avatar Tao Lyu avatar  avatar  avatar Rahul Y Gupta avatar  avatar Nicolas ROQUEBERT avatar James Njuguna Nduati avatar skyformat99 avatar  avatar Johans avatar  avatar Merouane avatar

calibre-web's Issues

Kindlegen conversation error

kindlegen sometimes fails while converting ebooks but in calibre web "Book successfully send to [email protected]" message is shown and an e-mail is sent without an attachment.

[email protected]:~/cw/calibre-web/vendor$ sudo ./kindlegen /home/ouz/kendal2/library/Joe\ Abercrombie/Sharp\ Ends_\ Stories\ from\ the\ World\ of\ The\ First\ Law\ \(4\)/Sharp\ Ends_\ Stories\ from\ the\ World\ of\ The\ -\ Joe\ Abercrombie.epub

*************************************************************
 Amazon kindlegen(Linux) V2.9 build 1028-0897292 
 A command line e-book compiler 
 Copyright Amazon.com and its Affiliates 2014 
*************************************************************

Info(prcgen):I1047: Added metadata dc:Title        "Sharp Ends: Stories from the World of The First Law"
Info(prcgen):I1047: Added metadata dc:Date         "2016-04-25T22:00:00+00:00"
Info(prcgen):I1047: Added metadata dc:Creator      "Joe Abercrombie"
Info(prcgen):I1047: Added metadata dc:Publisher    "Orion"
Info(prcgen):I1047: Added metadata dc:Contributor  "calibre (2.55.0) [http://calibre-ebook.com]"
Info(prcgen):I1047: Added metadata dc:Rights       "All rights reserved"
Info(prcgen):I1047: Added metadata dc:Description  "The Union army may be full of bastards, but there's only one who thinks he can save the day single-handed when the Gurkish come calling: the incomparable Colonel Sand dan Glokta. Curnden Craw and his dozen are out to recover a mysterious item from beyond the Crinna. Only one small 
Info(cssparser):I10004: @rules other than @import, @charset and @font-face are not supported.
Info(prcgen):I1052: Kindle support cover images but does not support cover HTML. Hence using the cover image specified and suppressing cover HTML in content.     URL: /tmp/mobi-Achwwt/titlepage.xhtml
Info(prcgen):I1002: Parsing files  0000034
Warning(prcfile):W14028: Following file does not exist :   styles/XXXXXXXXXXXXXXXX
Info(cssparser):I10006: Invalid syntax for url(), ignoring the URI. "/tmp/mobi-Achwwt/page_styles.css"
Info(prcgen):I1015: Building PRC file
Info(prcgen):I1006: Resolving hyperlinks
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/kindle:embed:0002?mime=image/jpg
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0000.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0001.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0003.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0005.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0007.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0009.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0011.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0013.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0015.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0017.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0019.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0021.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0023.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0027.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0029.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0031.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0032.html#Sharp-Ends-epub
Warning(prcgen):W14001: Hyperlink not resolved:  /tmp/mobi-Achwwt/text/part0033.html#Sharp-Ends-epub
Warning(prcgen):W14002: Some hyperlinks could not be resolved.
Info(prcgen):I1049: Building table of content     URL: /tmp/mobi-Achwwt/toc.ncx
Error(prcgen):E24010: Hyperlink not resolved in toc (One possible reason can be that the link points to a tag with style display:none):/tmp/mobi-Achwwt/text/part0000.html#Sharp-Ends-epub
Error(prcgen):E24001: The table of content could not be built.
Info(prcgen):I1016: Building enhanced PRC file
Info(prcgen):I1007: Resolving mediaidlinks
Info(prcgen):I1011: Writing mediaidlinks
Info(prcgen):I1009: Resolving guide items
Info(pagemap):I8000: No Page map found in the book
Info(prcgen):I1045: Computing UNICODE ranges used in the book
Info(prcgen):I1046: Found UNICODE range: Basic Latin [20..7E]
Info(prcgen):I1046: Found UNICODE range: General Punctuation - Windows 1252 [2018..201A]
Info(prcgen):I1046: Found UNICODE range: Latin-1 Supplement [A0..FF]
Info(prcgen):I1017: Building PRC file, record count:   0000182
Info(prcgen):I1039: Final stats - text compressed to (in % of original size):  52.49%
Info(prcgen):I1040: The document identifier is: "Sharp_Ends_S-_The_First_Law"
Info(prcgen):I1041: The file format version is V8
Info(prcgen):I1031: Saving PRC file
Info(prcgen):I1032: PRC built successfully
Info(prcgen):I1038: MOBI file could not be generated because of errors!

`

Remove trailing spaces

on Mobile devices often times trailing spaces are put behind words by the keyboards auto suggest. in the search box these spaces should be removed before initiating the search as for instance "Douglas Adams " won't yield a result although "Douglas Adams" does.

make "Discover (Random Books)" optional

this maybe a good category if you sell books but for my personal library it is quite unnecessary, so I think especially in the "new books" area this should at least be optional?

Errors at startup/access

When I start the application and try to access the webpage the following error is logged (and the page is not loaded). Could you please advise what might be wrong?

Config:
[email protected]:/opt/calibre-web# cat config.ini
[General]
DB_ROOT = /dikkert/Server/Books/Library
APP_DB_ROOT = /opt/calibre-web
MAIN_DIR = /opt/calibre-web
LOG_DIR = /opt/calibre-web
PORT = 8282
NEWEST_BOOKS = 60
[Advanced]
TITLE_REGEX = ^(A|The|An|Der|Die|Das|Den|Ein|Eine|Einen|Dem|Des|Einem|Eines)\s+
DEVELOPMENT = 0
PUBLIC_REG = 0
UPLOADING = 1
ANON_BROWSE = 0

Debug: debug.txt
Normal log below

[email protected]:/opt/calibre-web# python --version Python 2.7.9 [email protected]:/opt/calibre-web# python cps.py ERROR:cps.web:Exception on / [GET] Traceback (most recent call last): File "/opt/calibre-web/vendor/flask/app.py", line 1817, in wsgi_app response = self.full_dispatch_request() File "/opt/calibre-web/vendor/flask/app.py", line 1477, in full_dispatch_request rv = self.handle_user_exception(e) File "/opt/calibre-web/vendor/flask/app.py", line 1381, in handle_user_exception reraise(exc_type, exc_value, tb) File "/opt/calibre-web/vendor/flask/app.py", line 1475, in full_dispatch_request rv = self.dispatch_request() File "/opt/calibre-web/vendor/flask/app.py", line 1461, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/opt/calibre-web/vendor/flask_login.py", line 715, in decorated_view elif not current_user.is_authenticated(): File "/opt/calibre-web/vendor/werkzeug/local.py", line 338, in __getattr__ return getattr(self._get_current_object(), name) File "/opt/calibre-web/vendor/werkzeug/local.py", line 297, in _get_current_object return self.__local() File "/opt/calibre-web/vendor/flask_login.py", line 46, in <lambda> current_user = LocalProxy(lambda: _get_user() or File "/opt/calibre-web/vendor/flask_login.py", line 753, in _get_user current_app.login_manager._load_user() File "/opt/calibre-web/vendor/flask_login.py", line 335, in _load_user return self._load_from_header(request.headers[header_name]) File "/opt/calibre-web/vendor/flask_login.py", line 393, in _load_from_header user = self.header_callback(header) File "/opt/calibre-web/cps/web.py", line 116, in load_user_from_header basic_password = header_val.split(':')[1] IndexError: list index out of range ERROR:tornado.access:500 GET / (::1) 22.11ms WARNING:tornado.access:404 GET /favicon.ico (::1) 1.59ms

Control-C:
^CTraceback (most recent call last): File "cps.py", line 25, in <module> IOLoop.instance().start() File "/opt/calibre-web/vendor/tornado/ioloop.py", line 646, in start event_pairs = self._impl.poll(poll_timeout) KeyboardInterrupt

"No such table" error when clicking on a book

After starting calibre-web with python cps.py I can navigate around the site and all of the books in my library are properly displayed. If I click on a book I get a 500 error.

I believe I'm getting the same error in docker, though I'm not getting any traceback output when attaching to the container. The webpage shows the same 500 error.

OS: 64bit Mac OS X 10.11.4 15E65
Kernel: x86_64 Darwin 15.4.0
Calibre: 2.53
Python: 2.7.11

ERROR:cps.web:Exception on /book/125 [GET]
Traceback (most recent call last):
  File "/Users/jgillman/Code/calibre-web/vendor/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/jgillman/Code/calibre-web/vendor/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/jgillman/Code/calibre-web/vendor/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/jgillman/Code/calibre-web/vendor/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/jgillman/Code/calibre-web/vendor/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/jgillman/Code/calibre-web/vendor/flask_login.py", line 717, in decorated_view
    return func(*args, **kwargs)
  File "/Users/jgillman/Code/calibre-web/cps/web.py", line 381, in show_book
    return render_template('detail.html', entry=entries,  cc=cc, title=entries.title, books_shelfs=book_in_shelfs)
  File "/Users/jgillman/Code/calibre-web/vendor/flask/templating.py", line 128, in render_template
    context, ctx.app)
  File "/Users/jgillman/Code/calibre-web/vendor/flask/templating.py", line 110, in _render
    rv = template.render(context)
  File "/Users/jgillman/Code/calibre-web/vendor/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/Users/jgillman/Code/calibre-web/vendor/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/jgillman/Code/calibre-web/cps/templates/detail.html", line 1, in top-level template code
    {% extends "layout.html" %}
  File "/Users/jgillman/Code/calibre-web/cps/templates/layout.html", line 136, in top-level template code
    {% block body %}{% endblock %}
  File "/Users/jgillman/Code/calibre-web/cps/templates/detail.html", line 66, in block "body"
    {% if entry['custom_column_' ~ c.id]|length > 0 %}
  File "/Users/jgillman/Code/calibre-web/vendor/jinja2/environment.py", line 387, in getitem
    return getattr(obj, attr)
  File "/Users/jgillman/Code/calibre-web/vendor/sqlalchemy/orm/attributes.py", line 316, in __get__
    return self.impl.get(instance_state(instance), dict_)
  File "/Users/jgillman/Code/calibre-web/vendor/sqlalchemy/orm/attributes.py", line 613, in get
    value = self.callable_(state, passive)
  File "/Users/jgillman/Code/calibre-web/vendor/sqlalchemy/orm/strategies.py", line 524, in _load_for_state
    return self._emit_lazyload(session, state, ident_key, passive)
  File "/Users/jgillman/Code/calibre-web/vendor/sqlalchemy/orm/strategies.py", line 585, in _emit_lazyload
    result = q.all()
  File "/Users/jgillman/Code/calibre-web/vendor/sqlalchemy/orm/query.py", line 2241, in all
    return list(self)
  File "/Users/jgillman/Code/calibre-web/vendor/sqlalchemy/orm/query.py", line 2353, in __iter__
    return self._execute_and_instances(context)
  File "/Users/jgillman/Code/calibre-web/vendor/sqlalchemy/orm/query.py", line 2368, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/Users/jgillman/Code/calibre-web/vendor/sqlalchemy/engine/base.py", line 662, in execute
    params)
  File "/Users/jgillman/Code/calibre-web/vendor/sqlalchemy/engine/base.py", line 761, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/Users/jgillman/Code/calibre-web/vendor/sqlalchemy/engine/base.py", line 874, in _execute_context
    context)
  File "/Users/jgillman/Code/calibre-web/vendor/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
    exc_info
  File "/Users/jgillman/Code/calibre-web/vendor/sqlalchemy/util/compat.py", line 196, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/Users/jgillman/Code/calibre-web/vendor/sqlalchemy/engine/base.py", line 867, in _execute_context
    context)
  File "/Users/jgillman/Code/calibre-web/vendor/sqlalchemy/engine/default.py", line 324, in do_execute
    cursor.execute(statement, parameters)
OperationalError: (OperationalError) no such table: books_custom_column_1_link u'SELECT custom_column_1.id AS custom_column_1_id, custom_column_1.value AS custom_column_1_value \
nFROM custom_column_1, books_custom_column_1_link \nWHERE ? = books_custom_column_1_link.book AND custom_column_1.id = books_custom_column_1_link.value' (125,)
ERROR:tornado.access:500 GET /book/125 (::1) 89.60ms

error when reading book in browser (config problem?)

when I try to read a book in the browser I get things like below.

It may be a problem in the config.ini (it needs some documentation). I simply filled the db_root = line...

WARNING:tornado.access:404 GET /cover/bookname (1.2.3.4) 8.70ms
ERROR:cps.web:Exception on /read/2853 [GET]
Traceback (most recent call last):
  File "/opt/calibre-web/vendor/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/calibre-web/vendor/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/calibre-web/vendor/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/calibre-web/vendor/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/calibre-web/vendor/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/calibre-web/vendor/flask_login.py", line 717, in decorated_view
    return func(*args, **kwargs)
  File "/opt/calibre-web/cps/web.py", line 507, in read_book
    os.mkdir(newDir)
OSError: [Errno 2] No such file or directory: '/opt/calibre-web/cps/static/2853/OEBPS/images/diagram'
ERROR:tornado.access:500 GET /read/2853 (87.157.53.113) 860.93ms

No cover images displayed

With my Calibre library, no cover image can be displayed. From the traceback shown below, I guess you should use unicode encoding when constructing the file system path for serving an image:

ERROR:cps.web:Exception on /cover/Ellen Porath/Der Bund der Drachenlanze 9 - Stahl (165) [GET]
Traceback (most recent call last):
  File "C:\Program Files\Calibre2\calibre-web-master\vendor\flask\app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Program Files\Calibre2\calibre-web-master\vendor\flask\app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Program Files\Calibre2\calibre-web-master\vendor\flask\app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "C:\Program Files\Calibre2\calibre-web-master\vendor\flask\app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Program Files\Calibre2\calibre-web-master\vendor\flask\app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "C:\Program Files\Calibre2\calibre-web-master\vendor\flask_login.py", line 717, in decorated_view
    return func(*args, **kwargs)
  File "C:\Program Files\Calibre2\calibre-web-master\cps\web.py", line 529, in get_cover
    return send_from_directory(os.path.join(config.DB_ROOT, cover_path), "cover.jpg")
  File "C:\Python27\lib\ntpath.py", line 85, in join
    result_path = result_path + p_path
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal not in range(128)
ERROR:tornado.access:500 GET /cover/Ellen%20Porath/Der%20Bund%20der%20Drachenlanze%209%20-%20Stahl%20%28165%29 (::1) 5.00ms

Note that the image URLs referenced in the generated HTML looked normal to me.

Error when opening advanced search

I'm getting the following error report in the logs.

[2016-10-03 00:43:43,826] {/opt/calibre/vendor/flask/app.py:1423} ERROR - Exception on /advanced_search [GET]
Traceback (most recent call last):
  File "/opt/calibre/vendor/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/calibre/vendor/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/calibre/vendor/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/calibre/vendor/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/calibre/vendor/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/calibre/cps/web.py", line 492, in advanced_search
    author_name = request.args.get("author_name").strip()
AttributeError: 'NoneType' object has no attribute 'strip'

send to kindle error

send to kindle throws an error:

ERROR:cps.web:Exception on /send/2853 [GET]
Traceback (most recent call last):
  File "/opt/calibre-web/vendor/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/calibre-web/vendor/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/calibre-web/vendor/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/calibre-web/vendor/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/calibre-web/vendor/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/calibre-web/vendor/flask_login.py", line 717, in decorated_view
    return func(*args, **kwargs)
  File "/opt/calibre-web/cps/web.py", line 179, in inner
    return f(*args, **kwargs)
  File "/opt/calibre-web/cps/web.py", line 611, in send_to_kindle
    result = helper.send_mail(book_id, current_user.kindle_mail)
  File "/opt/calibre-web/cps/helper.py", line 131, in send_mail
    except (socket.error, smtplib.SMTPRecipientsRefused, smtplib.SMTPException), e:
NameError: global name 'socket' is not defined
ERROR:tornado.access:500 GET /send/2853 (1.2.3.4) 1213.13ms

Enhancement: Anon permissions

Is there any way that you could extend the permission model under the admin section to anon users? As far as I can tell, a lot of epub readers don't have interfaces for auth through the OPDS feed. Unless I'm missing something.

Mail Send Problem

From Dockerhub :
is the mail send function up to date?
filled in the smtp settings in the admin menu, but i'll get an error message

Could you open an issue report on GitHub and paste the error log? Thanks!

where is the error log located?

OPDS Catalogs

Hello,
everything works fine, but have a question. Is it possible to expand the list of items in OPDS catalog? It is very difficult to find a book when there is only hot books, new books, and random books.

Book description html is broken

Hi,

In the webview the html is stripped and all text is appended after each other. It looks like there
is something wrong with loading/displaying the description in the webui.

screen shot 2015-10-11 at 12 49 47

screen shot 2015-10-11 at 12 49 37

Browse by series

Would be nice to be able to browse by series, like the Calibre Content Server.

500 Internal Server Error

Hello, thanks for this promising piece of software. I was looking for a more convenient way to access my ebook library from the network, and I think this is just what I was looking for.

Anyway, I often get this error on the browser (Firefox and Chrome):

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the aplication.

While in the command line I can read this:

[email protected]:~/calibre-web-biblio# python cps.py
ERROR:cps.web:Exception on / [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/root/calibre-web-biblio/cps/web.py", line 393, in index
    return render_template('index.html', random=random, entries=entries, pagination=pagination, title="Latest Books")
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 128, in render_template
    context, ctx.app)
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 110, in _render
    rv = template.render(context)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/root/calibre-web-biblio/cps/templates/index.html", line 1, in top-level template code
    {% extends "layout.html" %}
  File "/root/calibre-web-biblio/cps/templates/layout.html", line 66, in top-level template code
    {% if g.user.is_authenticated() %}
AttributeError: 'bool' object has no attribute '__call__'
ERROR:tornado.access:500 GET / (192.168.1.132) 3776.21ms

Sometimes I can work around it if I first load http://localhost:8083/feed and then enter the main web page, but not all the time. Am I doing something wrong? The script is running on a Debian jessie server which is up to date.

Thank you in advance.

Suggestion: display number of books in each category/tag

It would be nice to show how many books are under each category in the category list. This way, you can easily spot the most popular categories and find out which is the right one when there are duplicates. It's also the default behaviour of the official calibre web interface.

Unable to create Admin user

Just stumbled upon your fork of this project.
What is the reason you decided to fork it, if I may ask?

When I start the cps.py I never get the option to create a admin user.

refresh library?

I have some new books in the calibre db but I don't see them in calibre-web until I restart the script.

Is there some kind of cache inside calibre-web?

send to kindle without authentication?

It looks like I cannot send to kindle via SMTP without authentication.

I have a smart host which authenticates via IP and brings me

There was an error sending this book: Failed to send mail: (435, 'Unable to authenticate at present')

unfortunately, I cannot look into the log of the relayserver (it's antispamcloud.com) but I think you send some bogus authentication when you just should connect to the server without authentication.

I wonder why you not simply use sendmail?

Reverse proxy subdirectory: Logout-Issue

Hi there,

the Reverse proxy subdirectory-Support was exactly what I need and it works quiete well. But when I click on Logout, the page redirects to its base-url (without the prefix).

EDIT: Seems that is also true for login/register?

Regards

Download as PDF

Hi, I have Calibre running on Debian Jessie (v.8.5).
Also installed calibre-web. I really enjoy it.

I was wondering how can I integrate "ebook-convert" tool (from Calibre) to allow downloading epub as PDF?
Thanks!

Enhancement: add license to calibre-web

as far as i can see calibre-web and the original calibreserver do not use any license.
i think we should contact Raphael Mutschler and ask him to add a 'free' license

or do we already have a license and i didn't find it?

Logging in after logging out after a search results in a 500 error.

The following scenario leads to a thrown exception in the code:

  1. I'm logged in, and perform a normal search. Note that it doesn't happen with an advanced search.
  2. While the search results are still visible, i log out.
  3. I now immedeatly either log in as the same user or another user.
  4. It returns to the search result page, but with an empty query (http:/calibremachine.home/calibre/search for example)

And that results in the followin exception being thrown:

Oct 04 21:35:58 calibremachine python2[343]: ERROR:cps.web:Exception on /search [GET]
Oct 04 21:35:58 calibremachine python2[343]: Traceback (most recent call last):
Oct 04 21:35:58 calibremachine python2[343]:   File "/usr/share/webapps/calibre-web/vendor/flask/app.py", line 1817, in wsgi_app
Oct 04 21:35:58 calibremachine python2[343]:     response = self.full_dispatch_request()
Oct 04 21:35:58 calibremachine python2[343]:   File "/usr/share/webapps/calibre-web/vendor/flask/app.py", line 1477, in full_dispatch_request
Oct 04 21:35:58 calibremachine python2[343]:     rv = self.handle_user_exception(e)
Oct 04 21:35:58 calibremachine python2[343]:   File "/usr/share/webapps/calibre-web/vendor/flask/app.py", line 1381, in handle_user_exception
Oct 04 21:35:58 calibremachine python2[343]:     reraise(exc_type, exc_value, tb)
Oct 04 21:35:58 calibremachine python2[343]:   File "/usr/share/webapps/calibre-web/vendor/flask/app.py", line 1475, in full_dispatch_request
Oct 04 21:35:58 calibremachine python2[343]:     rv = self.dispatch_request()
Oct 04 21:35:58 calibremachine python2[343]:   File "/usr/share/webapps/calibre-web/vendor/flask/app.py", line 1461, in dispatch_request
Oct 04 21:35:58 calibremachine python2[343]:     return self.view_functions[rule.endpoint](**req.view_args)
Oct 04 21:35:58 calibremachine python2[343]:   File "/usr/share/webapps/calibre-web/vendor/flask_login.py", line 717, in decorated_view
Oct 04 21:35:58 calibremachine python2[343]:     return func(*args, **kwargs)
Oct 04 21:35:58 calibremachine python2[343]:   File "/usr/share/webapps/calibre-web/cps/web.py", line 477, in search
Oct 04 21:35:58 calibremachine python2[343]:     term = request.args.get("query").strip()
Oct** 04 21:35:58 calibremachine python2[343]: AttributeError: 'NoneType' object has no attribute 'strip'
Oct 04 21:35:58 calibremachine python2[343]: ERROR:tornado.access:500 GET /calibre/search (10.10.0.100) 50.28ms

The advanced search just returns me to the advanced search page in this case.

If i manually change the url from calibre/search to calibre/ in my example, i'm correctly logged in and it works normally.

Closing the tab or the browser and normally going to the login page doesn't do this as well.

"Calibre database directory (DB_ROOT) is not configured"

Hi,

When I run /usr/bin/python /opt/calibre-web/cps.py from my home dir I get this error:
Calibre database directory (DB_ROOT) is not configured

When I run /usr/bin/python /opt/calibre-web/cps.py from /opt/calibre-web/ it runs perfectly!

I want to use the command to start the calibre-web instance at boot, but when I add it to crontab I get that same error message.

Can you help me?

Error: Calibre Database Directory <DB_ROOT> is not configured

Hi
i try to use this calibre-web,
i download it and unzip it to C:\calibre-web-master
I did rename and change the config file
[General]
DB_ROOT = C:\Users\S\Documents\Calibre Library
APP_DB_ROOT =
MAIN_DIR =
LOG_DIR =
PORT = 8083
NEWEST_BOOKS = 60
[Advanced]
TITLE_REGEX = ^(A|The|An|Der|Die|Das|Den|Ein|Eine|Einen|Dem|Des|Einem|Eines)\s+
DEVELOPMENT = 0
PUBLIC_REG = 0
UPLOADING = 0
ANON_BROWSE = 0

when i run cps.py
C:\Python27>Python C:\calibre-web-master\cps.py
i got an error "Calibre Database Directory <DB_ROOT> is not configured"

what can it put DB_ROOT = C:\Users\S\Documents\Calibre Library
or i need to add any thing
please help

layout of book page makes download on Kindle hard

the single book page (with the download buttons below the cover) is almost unusable on the kindle. to download a book the dropdown for epub/kindle opens and the kindle entry is very close to the bottom of the page, so you need a lot of trial and error before you hit the entry. I think the screen on the kindle is not very sensitive so close to the frame.

40 pixel margin-bottom should solve this problem..

Error When Launching From Other Directory

Good Afternoon -

Thanks for your work on this - much better than the OEM server! I have a potential issue or question, please. I have multiple Calibre libraries - each dedicated to specific content (Magazines, Technical Reference, Books, etc.) I found that I could run multiple instances of this script at once - each set to a different port, of course.

When I attempt to launch them using a string like
python "C:\Program Files (x86)\Calibre Web Servers\Books\cps.py"
, I get the error
python: can't open file 'C:\Program': [Errno 2] No such file or directory.
However, changing to that directory then executing "python cps.py" works.

I'm not a Python expert so really don't know if this is a script or Python thing, but is there a way to launch without first changing directory? Python is in my path.

Thanks!

remove menu from login page

maybe I am missing something, but as the menu (hot/new/discover) doesn't work before login, I think it should be removed from the login page..

language filter

could you implement a section for books in different languages similar to authors and categories on the left side?

Feature : Mark as Read By User

Thanks for this development, it's awesome.
Is there a way or what is the best way to easely implement "mark read/not read" by user ?

upload?!

is the upload functionality not implemented yet or am I just to blind to find it?

Enhancement: enhanced rights management

for my usecase i would need an enhanced right mangagement.
my suggestion: use more different numbers in the role field for the different rights:
1=admin
0=download books
2=download and edit books
3=download, edit and upload books

moreover i would add an option in the config to show books only to authenticated users an redirect others to the login page.

@janeczku would you support such an Implementation?

add shebang to cps.py

could you add

!/usr/bin/env python

on top of cps.py so that we can create an init.d/systemd startup script?

Enhancement: Support Calibre Custom-Columns

For my use case i will need custom columns. As i am not very familiar with SqlAlchemy i would like to discuss which is a good way to implement it.
what i tried so far is this:

cc = conn.execute("SELECT id FROM custom_columns")
cc_ids = []
books_custom_column_links = {}
for row in cc:
    cc_link=Table('books_custom_column_' + str(row.id) + '_link', Base.metadata,
        Column('book', Integer, ForeignKey('books.id'), primary_key=True),
        Column('custom_column', Integer, ForeignKey('custom_column_' + str(row.id) + '.id'), primary_key=True)
        )
    books_custom_column_links[row.id] = cc_link
    cc_ids.append(row.id)
class Custom_Column(object):
    def __init__(self, value):
        self.value = value

def get_cc_table(id):
    custom_column = Custom_Column
    table_name = 'custom_column_' + str(id)
    table_object = Table(table_name, Base.metadata,
        Column('id', Integer, primary_key=True, autoincrement=True),
        Column('value', String)
    )
    clear_mappers()
    mapper(custom_column, table_object, properties={'books' + str(id): relationship(Books, secondary=books_custom_column_links[id] , backref='custom_column_' + str(id))})
    return custom_column

cc_classes={}
for id in cc_ids:
    cc_classes[id] = get_cc_table(id)
print cc_classes

but mixing classical mapping with declarative mapping only led to errors due to my lack of SqlAlchemy experience.
Does anyone have a good solution for this or hints for me where i can learn about mixing classical and declarative mapping. Or even someone who would like to help me with sqlalchemy? in the last case i would commit my first experiments to my development branch

An other approach would be to use plain sql through conn.execute and write helper.get_custom_columns and helper.set_custom_columns functions.

Support for reverse proxy

Maybe this is already available and I'm just missing it.

I have several services running on my domain and I'm using Nginx to reverse proxy them. For example, instead of having to go to example.com:8080 I would go to example.com/calibre.

Calibre's built in web server lets you do this by passing the --url-prefix=/calibre flag. Perhaps something similar could be done here?


Side note: I'm currently using the docker container to run this. Works fine from localhost and it looks beautiful!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.