Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
2343c791
Commit
2343c791
authored
Nov 15, 2020
by
verglor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use djvu_html5 to read djvu format in browser
parent
09a5a69f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
5 deletions
+8
-5
README.md
README.md
+1
-1
helper.py
cps/helper.py
+1
-1
readdjvu.html
cps/templates/readdjvu.html
+3
-3
web.py
cps/web.py
+3
-0
No files found.
README.md
View file @
2343c791
...
...
@@ -22,7 +22,7 @@ Calibre-Web is a web app providing a clean interface for browsing, reading and d
-
Support for public user registration
-
Send eBooks to Kindle devices 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)
-
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
...
...
cps/helper.py
View file @
2343c791
...
...
@@ -198,7 +198,7 @@ def check_send_to_kindle(entry):
# Check if a reader is existing for any of the book formats, if not, return empty list, otherwise return
# list with supported formats
def
check_read_formats
(
entry
):
EXTENSIONS_READER
=
{
'TXT'
,
'PDF'
,
'EPUB'
,
'CBZ'
,
'CBT'
,
'CBR'
}
EXTENSIONS_READER
=
{
'TXT'
,
'PDF'
,
'EPUB'
,
'CBZ'
,
'CBT'
,
'CBR'
,
'DJVU'
}
bookformats
=
list
()
if
len
(
entry
.
data
):
for
ele
in
iter
(
entry
.
data
):
...
...
cps/
static/js/libs/djvu_html5/Djvu_html5
.html
→
cps/
templates/readdjvu
.html
View file @
2343c791
...
...
@@ -5,12 +5,12 @@
<meta
http-equiv=
"content-type"
content=
"text/html; charset=UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"
Djvu_html5.css
"
>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"
{{ url_for('static', filename='js/libs/djvu_html5/Djvu_html5.css') }}
"
>
<title>
Djvu HTML5 browser demo
</title>
<script
type=
"text/javascript"
language=
"javascript"
src=
"
djvu_html5/djvu_html5.nocache.js
"
></script>
src=
"
{{ url_for('static', filename='js/libs/djvu_html5/djvu_html5/djvu_html5.nocache.js') }}
"
></script>
</head>
<body>
...
...
@@ -23,7 +23,7 @@
application to display correctly.
</div>
</noscript>
<div
id=
"djvuContainer"
file=
"
sample/DjVu_Tech_Primer.djvu
"
></div>
<div
id=
"djvuContainer"
file=
"
{{ url_for('web.serve_book', book_id=djvufile,book_format='djvu') }}
"
></div>
<script
type=
"text/javascript"
>
var
DJVU_CONTEXT
=
{
background
:
"#666"
,
...
...
cps/web.py
View file @
2343c791
...
...
@@ -1843,6 +1843,9 @@ def read_book(book_id, book_format):
elif
book_format
.
lower
()
==
"txt"
:
log
.
debug
(
u"Start txt reader for
%
d"
,
book_id
)
return
render_title_template
(
'readtxt.html'
,
txtfile
=
book_id
,
title
=
_
(
u"Read a Book"
))
elif
book_format
.
lower
()
==
"djvu"
:
log
.
debug
(
u"Start djvu reader for
%
d"
,
book_id
)
return
render_title_template
(
'readdjvu.html'
,
djvufile
=
book_id
,
title
=
_
(
u"Read a Book"
))
else
:
for
fileExt
in
constants
.
EXTENSIONS_AUDIO
:
if
book_format
.
lower
()
==
fileExt
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment