kmoe-manga-downloader 1.2.8a0__tar.gz → 1.2.8a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/PKG-INFO +1 -1
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/_version.py +3 -3
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/core/defaults.py +1 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/downloader/DirectDownloader.py +16 -2
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/downloader/ReferViaDownloader.py +16 -2
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmoe_manga_downloader.egg-info/PKG-INFO +1 -1
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/tests/test_kmdr_download.py +50 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/.github/workflows/release-package.yml +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/.github/workflows/unit-test.yml +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/.gitignore +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/LICENSE +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/README.md +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/assets/kmdr-demo.gif +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/assets/kmdr-log-demo.gif +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/mirror/mirrors.json +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/pyproject.toml +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/setup.cfg +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/__init__.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/core/__init__.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/core/bases.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/core/console.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/core/constants.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/core/context.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/core/error.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/core/protocol.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/core/registry.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/core/session.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/core/structure.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/core/utils.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/main.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/__init__.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/authenticator/CookieAuthenticator.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/authenticator/LoginAuthenticator.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/authenticator/__init__.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/authenticator/utils.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/configurer/BaseUrlUpdator.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/configurer/ConfigClearer.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/configurer/ConfigUnsetter.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/configurer/OptionLister.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/configurer/OptionSetter.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/configurer/__init__.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/configurer/option_validate.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/downloader/__init__.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/downloader/download_utils.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/downloader/misc.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/lister/BookUrlLister.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/lister/FollowedBookLister.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/lister/__init__.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/lister/utils.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/picker/ArgsFilterPicker.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/picker/DefaultVolPicker.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/picker/__init__.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/picker/utils.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmoe_manga_downloader.egg-info/SOURCES.txt +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmoe_manga_downloader.egg-info/dependency_links.txt +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmoe_manga_downloader.egg-info/entry_points.txt +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmoe_manga_downloader.egg-info/requires.txt +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmoe_manga_downloader.egg-info/top_level.txt +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/tests/__init__.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/tests/test_async_retry_decorator.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/tests/test_kmdr_config_option.py +0 -0
- {kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/tests/test_utils_resolve_volme.py +0 -0
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '1.2.
|
|
32
|
-
__version_tuple__ = version_tuple = (1, 2, 8, '
|
|
31
|
+
__version__ = version = '1.2.8a1'
|
|
32
|
+
__version_tuple__ = version_tuple = (1, 2, 8, 'a1')
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'gb00d38e86'
|
|
@@ -71,6 +71,7 @@ def argument_parser():
|
|
|
71
71
|
download_parser.add_argument('-c', '--callback', type=str, help='每个卷下载完成后执行的回调脚本,例如: `echo {v.name} downloaded!`', required=False)
|
|
72
72
|
download_parser.add_argument('-m', '--method', type=int, help='下载方法,对应网站上的不同下载方式', required=False, choices=[1, 2], default=1)
|
|
73
73
|
download_parser.add_argument('--vip', action='store_true', help='尝试使用 VIP 链接进行下载(下载速度可能不及 CDN 方式)')
|
|
74
|
+
download_parser.add_argument('--disable-multi-part', action='store_true', help='禁用分片下载')
|
|
74
75
|
|
|
75
76
|
login_parser = subparsers.add_parser('login', help='登录到 Kmoe')
|
|
76
77
|
login_parser.add_argument('-u', '--username', type=str, help='用户名', required=True)
|
|
@@ -3,7 +3,7 @@ from functools import partial
|
|
|
3
3
|
from kmdr.core import Downloader, BookInfo, VolInfo, DOWNLOADER
|
|
4
4
|
from kmdr.core.constants import API_ROUTE
|
|
5
5
|
|
|
6
|
-
from .download_utils import download_file_multipart, readable_safe_filename
|
|
6
|
+
from .download_utils import download_file_multipart, readable_safe_filename, download_file
|
|
7
7
|
|
|
8
8
|
@DOWNLOADER.register(
|
|
9
9
|
hasvalues={
|
|
@@ -11,14 +11,28 @@ from .download_utils import download_file_multipart, readable_safe_filename
|
|
|
11
11
|
}
|
|
12
12
|
)
|
|
13
13
|
class DirectDownloader(Downloader):
|
|
14
|
-
def __init__(self, dest='.', callback=None, retry=3, num_workers=8, proxy=None, vip=False, *args, **kwargs):
|
|
14
|
+
def __init__(self, dest='.', callback=None, retry=3, num_workers=8, proxy=None, vip=False, disable_multi_part=False, *args, **kwargs):
|
|
15
15
|
super().__init__(dest, callback, retry, num_workers, proxy, *args, **kwargs)
|
|
16
16
|
self._use_vip = vip
|
|
17
|
+
self._disable_multi_part = disable_multi_part
|
|
17
18
|
|
|
18
19
|
async def _download(self, book: BookInfo, volume: VolInfo):
|
|
19
20
|
sub_dir = readable_safe_filename(book.name)
|
|
20
21
|
download_path = f'{self._dest}/{sub_dir}'
|
|
21
22
|
|
|
23
|
+
if self._disable_multi_part:
|
|
24
|
+
await download_file(
|
|
25
|
+
self._session,
|
|
26
|
+
self._semaphore,
|
|
27
|
+
self._progress,
|
|
28
|
+
partial(self.construct_download_url, book, volume),
|
|
29
|
+
download_path,
|
|
30
|
+
readable_safe_filename(f'[Kmoe][{book.name}][{volume.name}].epub'),
|
|
31
|
+
self._retry,
|
|
32
|
+
callback=lambda: self._callback(book, volume) if self._callback else None
|
|
33
|
+
)
|
|
34
|
+
return
|
|
35
|
+
|
|
22
36
|
await download_file_multipart(
|
|
23
37
|
self._session,
|
|
24
38
|
self._semaphore,
|
|
@@ -10,19 +10,33 @@ from kmdr.core.error import ResponseError
|
|
|
10
10
|
from kmdr.core.utils import async_retry
|
|
11
11
|
from kmdr.core.console import debug
|
|
12
12
|
|
|
13
|
-
from .download_utils import download_file_multipart, readable_safe_filename
|
|
13
|
+
from .download_utils import download_file, download_file_multipart, readable_safe_filename
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
@DOWNLOADER.register(order=10)
|
|
17
17
|
class ReferViaDownloader(Downloader):
|
|
18
|
-
def __init__(self, dest='.', callback=None, retry=3, num_workers=8, proxy=None, vip=False, *args, **kwargs):
|
|
18
|
+
def __init__(self, dest='.', callback=None, retry=3, num_workers=8, proxy=None, vip=False, disable_multi_part=False, *args, **kwargs):
|
|
19
19
|
super().__init__(dest, callback, retry, num_workers, proxy, *args, **kwargs)
|
|
20
20
|
self._use_vip = vip
|
|
21
|
+
self._disable_multi_part = disable_multi_part
|
|
21
22
|
|
|
22
23
|
async def _download(self, book: BookInfo, volume: VolInfo):
|
|
23
24
|
sub_dir = readable_safe_filename(book.name)
|
|
24
25
|
download_path = f'{self._dest}/{sub_dir}'
|
|
25
26
|
|
|
27
|
+
if self._disable_multi_part:
|
|
28
|
+
await download_file(
|
|
29
|
+
self._session,
|
|
30
|
+
self._semaphore,
|
|
31
|
+
self._progress,
|
|
32
|
+
partial(self.fetch_download_url, book.id, volume.id),
|
|
33
|
+
download_path,
|
|
34
|
+
readable_safe_filename(f'[Kmoe][{book.name}][{volume.name}].epub'),
|
|
35
|
+
self._retry,
|
|
36
|
+
callback=lambda: self._callback(book, volume) if self._callback else None
|
|
37
|
+
)
|
|
38
|
+
return
|
|
39
|
+
|
|
26
40
|
await download_file_multipart(
|
|
27
41
|
self._session,
|
|
28
42
|
self._semaphore,
|
|
@@ -3,6 +3,7 @@ import os
|
|
|
3
3
|
import time
|
|
4
4
|
import unittest
|
|
5
5
|
from argparse import Namespace
|
|
6
|
+
import warnings
|
|
6
7
|
|
|
7
8
|
from kmdr.main import main_sync as kmdr_main
|
|
8
9
|
from kmdr.core.constants import BASE_URL
|
|
@@ -249,6 +250,55 @@ class TestKmdrDownload(unittest.TestCase):
|
|
|
249
250
|
)
|
|
250
251
|
)
|
|
251
252
|
|
|
253
|
+
assert len(sub_dir := os.listdir(dest)) == 1, "Expected one subdirectory in the destination"
|
|
254
|
+
assert os.path.isdir(os.path.join(dest, book_dir := sub_dir[0])), "Expected the subdirectory to be a directory"
|
|
255
|
+
assert len(os.listdir(os.path.join(dest, book_dir))) == 1, "Expected 1 volume to be downloaded"
|
|
256
|
+
|
|
257
|
+
def test_download_volume_with_refer_via_downloader_disable_multi_part(self):
|
|
258
|
+
dest = f'{BASE_DIR}/{self.test_download_volume_with_refer_via_downloader_disable_multi_part.__name__}'
|
|
259
|
+
|
|
260
|
+
with warnings.catch_warnings():
|
|
261
|
+
warnings.filterwarnings("ignore", category=DeprecationWarning, message="本函数可能不会积极维护")
|
|
262
|
+
kmdr_main(
|
|
263
|
+
Namespace(
|
|
264
|
+
command='download',
|
|
265
|
+
dest=dest,
|
|
266
|
+
book_url=f'{DEFAULT_BASE_URL}/c/51043.htm',
|
|
267
|
+
vol_type='extra',
|
|
268
|
+
volume='all',
|
|
269
|
+
max_size=0.4,
|
|
270
|
+
limit=1,
|
|
271
|
+
retry=3,
|
|
272
|
+
num_workers=1,
|
|
273
|
+
disable_multi_part=True
|
|
274
|
+
)
|
|
275
|
+
)
|
|
276
|
+
|
|
277
|
+
assert len(sub_dir := os.listdir(dest)) == 1, "Expected one subdirectory in the destination"
|
|
278
|
+
assert os.path.isdir(os.path.join(dest, book_dir := sub_dir[0])), "Expected the subdirectory to be a directory"
|
|
279
|
+
assert len(os.listdir(os.path.join(dest, book_dir))) == 1, "Expected 1 volume to be downloaded"
|
|
280
|
+
|
|
281
|
+
def test_download_volume_with_direct_downloader_disable_multi_part(self):
|
|
282
|
+
dest = f'{BASE_DIR}/{self.test_download_volume_with_direct_downloader_disable_multi_part.__name__}'
|
|
283
|
+
|
|
284
|
+
with warnings.catch_warnings():
|
|
285
|
+
warnings.filterwarnings("ignore", category=DeprecationWarning, message="本函数可能不会积极维护")
|
|
286
|
+
kmdr_main(
|
|
287
|
+
Namespace(
|
|
288
|
+
command='download',
|
|
289
|
+
dest=dest,
|
|
290
|
+
book_url=f'{DEFAULT_BASE_URL}/c/51043.htm',
|
|
291
|
+
vol_type='extra',
|
|
292
|
+
volume='all',
|
|
293
|
+
max_size=0.4,
|
|
294
|
+
method=2, # use direct download method
|
|
295
|
+
limit=1,
|
|
296
|
+
retry=3,
|
|
297
|
+
num_workers=1,
|
|
298
|
+
disable_multi_part=True
|
|
299
|
+
)
|
|
300
|
+
)
|
|
301
|
+
|
|
252
302
|
assert len(sub_dir := os.listdir(dest)) == 1, "Expected one subdirectory in the destination"
|
|
253
303
|
assert os.path.isdir(os.path.join(dest, book_dir := sub_dir[0])), "Expected the subdirectory to be a directory"
|
|
254
304
|
assert len(os.listdir(os.path.join(dest, book_dir))) == 1, "Expected 1 volume to be downloaded"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/.github/workflows/unit-test.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/downloader/misc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/lister/__init__.py
RENAMED
|
File without changes
|
{kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/lister/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/picker/__init__.py
RENAMED
|
File without changes
|
{kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/src/kmdr/module/picker/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/tests/test_async_retry_decorator.py
RENAMED
|
File without changes
|
{kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/tests/test_kmdr_config_option.py
RENAMED
|
File without changes
|
{kmoe_manga_downloader-1.2.8a0 → kmoe_manga_downloader-1.2.8a1}/tests/test_utils_resolve_volme.py
RENAMED
|
File without changes
|