[2.1.5] - 2022-06-18
All checks were successful
ci/woodpecker/push/tests Pipeline was successful
ci/woodpecker/tag/tests Pipeline was successful
ci/woodpecker/tag/publish_release Pipeline was successful
ci/woodpecker/tag/publish_docker Pipeline was successful

## [2.1.5] - 2022-06-18

### Fixed

- Image names now have a suffix, as some comic readers have problems with no
  suffix [fixes issue #2]

### Added

- `--format` section in the README
This commit is contained in:
Ivan Schaller 2022-06-18 00:17:20 +02:00
commit d40a2cab8f
11 changed files with 63 additions and 24 deletions

View file

@ -30,6 +30,7 @@ pipeline:
dockerfile: docker/Dockerfile.amd64
auto_tag: true
auto_tag_suffix: linux-amd64
build_args: BUILD_DATE="$(date +%Y-%m-%d_%H:%M)"
# build docker image for arm64
dryrun-build-arm64:
@ -44,5 +45,6 @@ pipeline:
platforms: linux/arm64
dockerfile: docker/Dockerfile.arm64
auto_tag: true
auto_tag_suffix: linux-arm64
auto_tag_suffix: linux-arm64#
build_args: BUILD_DATE="$(date +%Y-%m-%d_%H:%M)"

View file

@ -29,6 +29,7 @@ pipeline:
dockerfile: docker/Dockerfile.amd64
auto_tag: true
auto_tag_suffix: linux-amd64
build_args: BUILD_DATE="$(date +%Y-%m-%d_%H:%M)"
username:
from_secret: cr-dhub-username
password:
@ -47,6 +48,7 @@ pipeline:
dockerfile: docker/Dockerfile.arm64
auto_tag: true
auto_tag_suffix: linux-arm64
build_args: BUILD_DATE="$(date +%Y-%m-%d_%H:%M)"
username:
from_secret: cr-dhub-username
password:

View file

@ -9,6 +9,17 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Add support for more sites
## [2.1.5] - 2022-06-18
### Fixed
- Image names now have a suffix, as some comic readers have problems with no
suffix [fixes issue #2]
### Added
- `--format` section in the README
## [2.1.4] - 2022-05-29
### Fixed

View file

@ -60,9 +60,6 @@ See the docker [README](./docker/README.md)
## Options
> "--format" currently only works with "", "pdf", "zip", "rar" and "cbz". As it just renames the zip file with the new
> suffix (except pdf). For pdf creation you have to install img2pdf.
```txt
usage: manga-dlp.py [-h] (-u URL_UUID | --read READ | -v) [-c CHAPTERS] [-p PATH] [-l LANG] [--list] [--format FORMAT] [--forcevol] [--wait WAIT] [--verbose]
@ -169,6 +166,33 @@ is `<script_dir>/downloads`. Absolute and relative paths are supported.
This will save all mangas/chapters in the path `/media/mangas/<manga title>/<chapter name>`
### Set output format
> `--format` currently only works with `""`, `"pdf"`, `"zip"`, `"rar"` and `"cbz"`.
> As it just renames the zip file with the new
> suffix (except pdf).
You can specify the output format of the manga images with the `--format` option.
The default is set to `.cbz`, so if no format is given it falls back to `<manga-name>/<chapter_name>.cbz`
For pdf creation you have to install [img2pdf](https://pypi.org/project/img2pdf/).
With the amd64 docker image it is already installed
see more in the Docker [README.md](docker/README.md).
#### Supported format options are:
* cbz - `--format "cbz"` or `--format ".cbz"` **- default**
* cbr - `--format "cbr"` or `--format ".cbr"`
* zip - `--format "zip"` or `--format ".zip"`
* pdf - `--format "pdf"` or `--format ".pdf"`
* _none_ - `--format ""` - this saves the images just in a folder
#### Example:
`python3 manga-dlp.py <other options> --format "zip"`
This will download the chapter and save it as a zip archive.
## Contribution / Bugs
For suggestions for improvement, just open a pull request.

View file

@ -1,13 +1,11 @@
FROM cr.44net.ch/baseimages/debian-s6:1.3.5
# set version label
ENV MDLP_VERSION=2.1.5
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL build_version="Version: ${MDLP_VERSION} - Build-date: ${BUILD_DATE}"
LABEL maintainer="Ivan Schaller"
# manga-dlp version
ENV MDLP_VERSION=2.1.4
# install packages
RUN \

View file

@ -1,13 +1,11 @@
FROM cr.44net.ch/baseimages/debian-s6:1.3.5
# set version label
ENV MDLP_VERSION=2.1.5
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL build_version="Version: ${MDLP_VERSION} - Build-date: ${BUILD_DATE}"
LABEL maintainer="Ivan Schaller"
# manga-dlp version
ENV MDLP_VERSION=2.1.4
# install packages
RUN \

View file

@ -3,7 +3,7 @@ import sys
from mangadlp.input import get_args
mangadlp_version = "2.1.4"
mangadlp_version = "2.1.5"
def get_input():

View file

@ -13,21 +13,23 @@ def download_chapter(
image_urls: list, chapter_path: str or Path, download_wait: float, verbose: bool
) -> None:
total_img = len(image_urls)
for img_num, img in enumerate(image_urls, 1):
for image_num, image in enumerate(image_urls, 1):
# get image suffix
image_suffix = str(Path(image).suffix) or ".png"
# set image path
image_path = Path(f"{chapter_path}/{img_num:03d}")
image_path = Path(f"{chapter_path}/{image_num:03d}{image_suffix}")
# show progress bar if verbose logging is not active
if verbose:
print(f"INFO: Downloading image {img_num}/{total_img}")
print(f"INFO: Downloading image {image_num}/{total_img}")
else:
utils.progress_bar(img_num, total_img)
utils.progress_bar(image_num, total_img)
counter = 1
while counter <= 3:
try:
r = requests.get(img, stream=True)
r = requests.get(image, stream=True)
if r.status_code != 200:
print(f"ERR: Request for image {img} failed, retrying")
print(f"ERR: Request for image {image} failed, retrying")
raise ConnectionError
except KeyboardInterrupt:
print("ERR: Stopping")
@ -50,5 +52,5 @@ def download_chapter(
print("ERR: Can't write file")
raise IOError
img_num += 1
image_num += 1
sleep(download_wait)

View file

@ -4,7 +4,7 @@ from pathlib import Path
import mangadlp.app as app
mangadlp_version = "2.1.4"
mangadlp_version = "2.1.5"
def check_args(args):

View file

@ -7,7 +7,7 @@ long_description = readme.read_text()
setuptools.setup(
name="manga-dlp",
version="2.1.4",
version="2.1.5",
author="Ivan Schaller",
author_email="ivan@schaller.sh",
description="A cli manga downloader",

View file

@ -1,8 +1,10 @@
import shutil
from pathlib import Path
import pytest
import requests
import mangadlp.downloader as downloader
import shutil
def test_downloader():
@ -21,7 +23,7 @@ def test_downloader():
images.append(file.name)
print(images)
assert images == ["001", "002", "003", "004", "005"]
assert images == ["001.png", "002.png", "003.png", "004.png", "005.png"]
# cleanup
shutil.rmtree(chapter_path, ignore_errors=True)