kmoe-manga-downloader 1.2.8a0__py3-none-any.whl → 1.2.8a1__py3-none-any.whl
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.
- kmdr/_version.py +2 -2
- kmdr/core/defaults.py +1 -0
- kmdr/module/downloader/DirectDownloader.py +16 -2
- kmdr/module/downloader/ReferViaDownloader.py +16 -2
- {kmoe_manga_downloader-1.2.8a0.dist-info → kmoe_manga_downloader-1.2.8a1.dist-info}/METADATA +1 -1
- {kmoe_manga_downloader-1.2.8a0.dist-info → kmoe_manga_downloader-1.2.8a1.dist-info}/RECORD +10 -10
- {kmoe_manga_downloader-1.2.8a0.dist-info → kmoe_manga_downloader-1.2.8a1.dist-info}/WHEEL +0 -0
- {kmoe_manga_downloader-1.2.8a0.dist-info → kmoe_manga_downloader-1.2.8a1.dist-info}/entry_points.txt +0 -0
- {kmoe_manga_downloader-1.2.8a0.dist-info → kmoe_manga_downloader-1.2.8a1.dist-info}/licenses/LICENSE +0 -0
- {kmoe_manga_downloader-1.2.8a0.dist-info → kmoe_manga_downloader-1.2.8a1.dist-info}/top_level.txt +0 -0
kmdr/_version.py
CHANGED
|
@@ -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
34
|
__commit_id__ = commit_id = None
|
kmdr/core/defaults.py
CHANGED
|
@@ -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,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
kmdr/__init__.py,sha256=iLmy2rOkHS_4KZWMD8BgT7R3tLMKeaTCDVf3B4FyYxM,91
|
|
2
|
-
kmdr/_version.py,sha256=
|
|
2
|
+
kmdr/_version.py,sha256=JyF-msezavGoYODPGaV_ID0jze_-I8yYyI16y_3GMJ0,712
|
|
3
3
|
kmdr/main.py,sha256=B9CK53GlWO91-135AJDFOfqglSmYJe5-nZrha4A0LLs,2166
|
|
4
4
|
kmdr/core/__init__.py,sha256=aR3mhP1A81oTmTnBOonVQm_mFvFeNCOo7kalZVfszAc,416
|
|
5
5
|
kmdr/core/bases.py,sha256=47M6VyrIMnmTEvwZtt8WsPAjGz5vagkRyTpci16aH2k,3973
|
|
6
6
|
kmdr/core/console.py,sha256=gD_PKjuAjePUJx-49ef9IBunetCiKt1LMI0EIU5kcZw,2016
|
|
7
7
|
kmdr/core/constants.py,sha256=JFj8FHO9ab6AeIzHz3LaC8l3ziLLFi75vil8wMPfZoA,1869
|
|
8
8
|
kmdr/core/context.py,sha256=ZhUfuCmZN0s1AQnxxkMFqYkCpjkRvJd53RUZWMhH8Gw,1390
|
|
9
|
-
kmdr/core/defaults.py,sha256=
|
|
9
|
+
kmdr/core/defaults.py,sha256=1Hh--iLw8nb8GJSpi9jcSfdOqVuj3S7eU6aymMDWZ68,9205
|
|
10
10
|
kmdr/core/error.py,sha256=gH4tcFpLRJXKQCwEnvfVM0lkhlakCwS-IYtNEkpO9a4,1984
|
|
11
11
|
kmdr/core/protocol.py,sha256=_4Ba6BU4oEFK2O61UH_-X2-bmZtUd61O20WGarvXVOM,399
|
|
12
12
|
kmdr/core/registry.py,sha256=m5jKma2SLbYN6hG2WqkxoyOYUENE4a-e0CzRALkGD7k,5654
|
|
@@ -25,8 +25,8 @@ kmdr/module/configurer/OptionLister.py,sha256=bGlrxouPiBGpGv8UiGPcT3KL6SWMJckQKd
|
|
|
25
25
|
kmdr/module/configurer/OptionSetter.py,sha256=BQXIgyLoMDSNua2x96FtX-9JmJhVpPJ5o0tWHj_-7B0,898
|
|
26
26
|
kmdr/module/configurer/__init__.py,sha256=nSWGwUCcwOkvg28zxRd0S3b4jeag_W0IhzP74xq0ewE,204
|
|
27
27
|
kmdr/module/configurer/option_validate.py,sha256=9QzVO9wwGwhXMPXx2zLJSIsyVle7-GTgxCoPn7Tp6kw,3535
|
|
28
|
-
kmdr/module/downloader/DirectDownloader.py,sha256=
|
|
29
|
-
kmdr/module/downloader/ReferViaDownloader.py,sha256=
|
|
28
|
+
kmdr/module/downloader/DirectDownloader.py,sha256=ewSOV1BQ80LOq0mA6Lpr9gaYYYl33REQK4CgYlfD83c,1980
|
|
29
|
+
kmdr/module/downloader/ReferViaDownloader.py,sha256=j61KQ6Gb6Unz3Ww6m-8s1zwNLUcgrU6o-8YfODdLr88,3130
|
|
30
30
|
kmdr/module/downloader/__init__.py,sha256=PajPBQ4ZJwz_6Ok6k-HV7-YSibxAW5m5voYyP-U-_f4,97
|
|
31
31
|
kmdr/module/downloader/download_utils.py,sha256=bFlrH4AUIyTJnGvIBk2geGrP5FzplHQdo1K2dxpIjRs,18872
|
|
32
32
|
kmdr/module/downloader/misc.py,sha256=P8hqtYIiD1AR6wzfJ0JBghpSJ_zx2_vTg8jDHcEU8hM,2328
|
|
@@ -38,9 +38,9 @@ kmdr/module/picker/ArgsFilterPicker.py,sha256=wBCDa6KsSSOLLQk8D4ftZ9ZnwPLiHIirxf
|
|
|
38
38
|
kmdr/module/picker/DefaultVolPicker.py,sha256=qScmRtwpe1u3fY7HMIo15YXtwB4LYAIJaTu_EkrAJbs,1780
|
|
39
39
|
kmdr/module/picker/__init__.py,sha256=qYELEkv0nFT8DadItB6fdUTED2CHrC43wuPKO7QrCCQ,93
|
|
40
40
|
kmdr/module/picker/utils.py,sha256=baJzpQSSSBdTPZ2scrEeNOssGYOL0nNwxN1gTsOAqnc,1604
|
|
41
|
-
kmoe_manga_downloader-1.2.
|
|
42
|
-
kmoe_manga_downloader-1.2.
|
|
43
|
-
kmoe_manga_downloader-1.2.
|
|
44
|
-
kmoe_manga_downloader-1.2.
|
|
45
|
-
kmoe_manga_downloader-1.2.
|
|
46
|
-
kmoe_manga_downloader-1.2.
|
|
41
|
+
kmoe_manga_downloader-1.2.8a1.dist-info/licenses/LICENSE,sha256=bKQlsXu8mAYKRZyoZKOEqMcCc8YjT5Q3Hgr21e0yU4E,1068
|
|
42
|
+
kmoe_manga_downloader-1.2.8a1.dist-info/METADATA,sha256=Lj7KQHbci4AWXASNBCL-VLh9BE9OLbOUpub7JU_6BG0,10116
|
|
43
|
+
kmoe_manga_downloader-1.2.8a1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
44
|
+
kmoe_manga_downloader-1.2.8a1.dist-info/entry_points.txt,sha256=DGMytQAhx4uNuKQL7BPkiWESHLXkH-2KSEqwHdygNPA,47
|
|
45
|
+
kmoe_manga_downloader-1.2.8a1.dist-info/top_level.txt,sha256=e0qxOgWp0tl3GLpmXGjZv3--q_TLoJ7GztM48Ov27wM,5
|
|
46
|
+
kmoe_manga_downloader-1.2.8a1.dist-info/RECORD,,
|
|
File without changes
|
{kmoe_manga_downloader-1.2.8a0.dist-info → kmoe_manga_downloader-1.2.8a1.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{kmoe_manga_downloader-1.2.8a0.dist-info → kmoe_manga_downloader-1.2.8a1.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{kmoe_manga_downloader-1.2.8a0.dist-info → kmoe_manga_downloader-1.2.8a1.dist-info}/top_level.txt
RENAMED
|
File without changes
|