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
6b6a457a
Unverified
Commit
6b6a457a
authored
Dec 15, 2017
by
Andriy Zasypkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comic reader updated extentions
parent
92493900
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
web.py
cps/web.py
+4
-4
No files found.
cps/web.py
View file @
6b6a457a
...
...
@@ -932,7 +932,7 @@ def get_comic_book(book_id, book_format, page):
for
bookformat
in
book
.
data
:
if
bookformat
.
format
.
lower
()
==
book_format
.
lower
():
cbr_file
=
os
.
path
.
join
(
config
.
config_calibre_dir
,
book
.
path
,
bookformat
.
name
)
+
"."
+
book_format
if
book_format
==
"cbr"
:
if
book_format
in
(
"cbr"
,
"rar"
)
:
if
rar_support
==
True
:
rarfile
.
UNRAR_TOOL
=
config
.
config_rarfile_location
try
:
...
...
@@ -949,7 +949,7 @@ def get_comic_book(book_id, book_format, page):
app
.
logger
.
info
(
'Unrar is not supported please install python rarfile extension'
)
# no support means return nothing
return
""
,
204
if
book_format
==
"cbz"
:
if
book_format
in
(
"cbz"
,
"zip"
)
:
zf
=
zipfile
.
ZipFile
(
cbr_file
)
zipNames
=
sorted
(
zf
.
namelist
())
if
sys
.
version_info
.
major
>=
3
:
...
...
@@ -959,8 +959,8 @@ def get_comic_book(book_id, book_format, page):
extractedfile
=
"data:image/png;base64,"
+
b64
fileData
=
{
"name"
:
zipNames
[
page
],
"page"
:
page
,
"last"
:
zipNames
.
__len__
()
-
1
,
"content"
:
extractedfile
}
if
book_format
==
"cbt"
:
tf
=
tarfile
.
TarFile
(
u'D:
\\
zip
\\
test.cbt'
)
if
book_format
in
(
"cbt"
,
"tar"
)
:
tf
=
tarfile
.
TarFile
(
cbr_file
)
tarNames
=
sorted
(
tf
.
getnames
())
if
sys
.
version_info
.
major
>=
3
:
b64
=
codecs
.
encode
(
tf
.
extractfile
(
tarNames
[
page
])
.
read
(),
'base64'
)
.
decode
()
...
...
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