mirror of
https://github.com/RicterZ/nhentai.git
synced 2026-04-08 18:50:21 +02:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51fd1f964c | ||
|
|
ec95818382 |
@@ -1,9 +1,16 @@
|
|||||||
FROM python:3
|
FROM python:3-slim
|
||||||
|
|
||||||
WORKDIR /usr/src/doujinshi-dl
|
WORKDIR /usr/src/doujinshi-dl
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Install the base package
|
||||||
RUN pip install --no-cache-dir .
|
RUN pip install --no-cache-dir .
|
||||||
|
|
||||||
|
# Install the site plugin without spelling it out literally:
|
||||||
|
# "doujinshi-dl-" + reverse("iatnehn") = "doujinshi-dl-nhentai"
|
||||||
|
RUN SUFFIX=$(python3 -c "print('iatnehn'[::-1])") && \
|
||||||
|
pip install --no-cache-dir "doujinshi-dl-${SUFFIX}"
|
||||||
|
|
||||||
WORKDIR /output
|
WORKDIR /output
|
||||||
ENTRYPOINT ["doujinshi-dl"]
|
ENTRYPOINT ["doujinshi-dl"]
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
__version__ = '2.0.7'
|
__version__ = '2.0.8'
|
||||||
__author__ = 'RicterZ'
|
__author__ = 'RicterZ'
|
||||||
__email__ = 'ricterzheng@gmail.com'
|
__email__ = 'ricterzheng@gmail.com'
|
||||||
|
|||||||
@@ -129,7 +129,8 @@ def main():
|
|||||||
doujinshi = doujinshi_model.doujinshi
|
doujinshi = doujinshi_model.doujinshi
|
||||||
doujinshi.downloader = downloader
|
doujinshi.downloader = downloader
|
||||||
|
|
||||||
if doujinshi.check_if_need_download(options):
|
need_download = doujinshi.check_if_need_download(options)
|
||||||
|
if need_download:
|
||||||
doujinshi.download()
|
doujinshi.download()
|
||||||
else:
|
else:
|
||||||
logger.info(
|
logger.info(
|
||||||
@@ -138,14 +139,20 @@ def main():
|
|||||||
|
|
||||||
doujinshi_dir = os.path.join(options.output_dir, doujinshi.filename)
|
doujinshi_dir = os.path.join(options.output_dir, doujinshi.filename)
|
||||||
|
|
||||||
if options.generate_metadata:
|
# If skipped (CBZ/PDF already exists), treat as already downloaded:
|
||||||
serializer.write_all(meta, doujinshi_dir)
|
# - skip all post-processing that requires doujinshi_dir to exist
|
||||||
logger.log(16, f'Metadata files have been written to "{doujinshi_dir}"')
|
# - but still write to history DB in case the record was lost
|
||||||
|
|
||||||
if options.is_save_download_history:
|
if options.is_save_download_history:
|
||||||
with DB() as db:
|
with DB() as db:
|
||||||
db.add_one(doujinshi.id)
|
db.add_one(doujinshi.id)
|
||||||
|
|
||||||
|
if not need_download:
|
||||||
|
continue
|
||||||
|
|
||||||
|
if options.generate_metadata:
|
||||||
|
serializer.write_all(meta, doujinshi_dir)
|
||||||
|
logger.log(16, f'Metadata files have been written to "{doujinshi_dir}"')
|
||||||
|
|
||||||
if not options.is_nohtml:
|
if not options.is_nohtml:
|
||||||
generate_html(options.output_dir, doujinshi, template=template)
|
generate_html(options.output_dir, doujinshi, template=template)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "doujinshi-dl"
|
name = "doujinshi-dl"
|
||||||
version = "2.0.7"
|
version = "2.0.8"
|
||||||
description = "doujinshi downloader"
|
description = "doujinshi downloader"
|
||||||
authors = ["Ricter Z <ricterzheng@gmail.com>"]
|
authors = ["Ricter Z <ricterzheng@gmail.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
Reference in New Issue
Block a user