jmcomic 2.6.10__tar.gz → 2.6.11__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.
Files changed (24) hide show
  1. {jmcomic-2.6.10/src/jmcomic.egg-info → jmcomic-2.6.11}/PKG-INFO +29 -11
  2. {jmcomic-2.6.10 → jmcomic-2.6.11}/README.md +28 -10
  3. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic/__init__.py +1 -1
  4. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic/jm_client_impl.py +30 -62
  5. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic/jm_client_interface.py +7 -1
  6. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic/jm_config.py +3 -2
  7. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic/jm_option.py +2 -2
  8. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic/jm_toolkit.py +16 -0
  9. {jmcomic-2.6.10 → jmcomic-2.6.11/src/jmcomic.egg-info}/PKG-INFO +29 -11
  10. {jmcomic-2.6.10 → jmcomic-2.6.11}/LICENSE +0 -0
  11. {jmcomic-2.6.10 → jmcomic-2.6.11}/pyproject.toml +0 -0
  12. {jmcomic-2.6.10 → jmcomic-2.6.11}/setup.cfg +0 -0
  13. {jmcomic-2.6.10 → jmcomic-2.6.11}/setup.py +0 -0
  14. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic/api.py +0 -0
  15. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic/cl.py +0 -0
  16. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic/jm_downloader.py +0 -0
  17. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic/jm_entity.py +0 -0
  18. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic/jm_exception.py +0 -0
  19. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic/jm_plugin.py +0 -0
  20. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic.egg-info/SOURCES.txt +0 -0
  21. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic.egg-info/dependency_links.txt +0 -0
  22. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic.egg-info/entry_points.txt +0 -0
  23. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic.egg-info/requires.txt +0 -0
  24. {jmcomic-2.6.10 → jmcomic-2.6.11}/src/jmcomic.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jmcomic
3
- Version: 2.6.10
3
+ Version: 2.6.11
4
4
  Summary: Python API For JMComic (禁漫天堂)
5
5
  Home-page: https://github.com/hect0x7/JMComic-Crawler-Python
6
6
  Author: hect0x7
@@ -56,17 +56,35 @@ Dynamic: home-page
56
56
  Dynamic: license-file
57
57
  Dynamic: requires-python
58
58
 
59
- # Python API For JMComic (禁漫天堂)
59
+ <!-- 顶部标题 & 统计徽章 -->
60
+ <div align="center">
61
+ <h1 style="margin-top: 0" align="center">Python API for JMComic</h1>
62
+ <p align="center">
63
+ <strong>提供 Python API 访问禁漫天堂(网页端 & 移动端),集成 GitHub Actions 下载器🚀</strong>
64
+ </p>
60
65
 
61
- 本项目封装了一套可用于爬取JM的Python API.
66
+ [![GitHub](https://img.shields.io/badge/-GitHub-181717?logo=github)](https://github.com/hect0x7)
67
+ [![Stars](https://img.shields.io/github/stars/hect0x7/JMComic-Crawler-Python?color=orange&label=stars&style=flat)](https://github.com/hect0x7/JMComic-Crawler-Python/stargazers)
68
+ [![Forks](https://img.shields.io/github/forks/hect0x7/JMComic-Crawler-Python?color=green&label=forks&style=flat)](https://github.com/hect0x7/JMComic-Crawler-Python/forks)
69
+ [![GitHub latest releases](https://img.shields.io/github/v/release/hect0x7/JMComic-Crawler-Python?color=blue&label=version)](https://github.com/hect0x7/JMComic-Crawler-Python/releases/latest)
70
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/jmcomic?style=flat&color=hotpink)](https://pepy.tech/projects/jmcomic)
71
+ [![Licence](https://img.shields.io/github/license/hect0x7/JMComic-Crawler-Python?color=red)](https://github.com/hect0x7/JMComic-Crawler-Python)
62
72
 
63
- 你可以通过简单的几行Python代码,实现下载JM上的本子到本地,并且是处理好的图片。
73
+ </div>
74
+
75
+
76
+
77
+
78
+ > 本项目封装了一套可用于爬取JM的Python API.
79
+ >
80
+ > 你可以通过简单的几行Python代码,实现下载JM上的本子到本地,并且是处理好的图片。
81
+ >
82
+ > **友情提示:珍爱JM,为了减轻JM的服务器压力,请不要一次性爬取太多本子,西门🙏🙏🙏**.
64
83
 
65
84
  [【指路】教程:使用GitHub Actions下载禁漫本子](./assets/docs/sources/tutorial/1_github_actions.md)
66
85
 
67
86
  [【指路】教程:导出并下载你的禁漫收藏夹数据](./assets/docs/sources/tutorial/10_export_favorites.md)
68
87
 
69
- **友情提示:珍爱JM,为了减轻JM的服务器压力,请不要一次性爬取太多本子,西门🙏🙏🙏**.
70
88
 
71
89
  ## 项目介绍
72
90
 
@@ -105,11 +123,11 @@ Dynamic: requires-python
105
123
 
106
124
  ### 1. 下载本子方法
107
125
 
108
- 只需要使用如下代码,就可以下载本子`JM422866`的所有章节的图片:
126
+ 只需要使用如下代码,就可以下载本子`JM123`的所有章节的图片:
109
127
 
110
128
  ```python
111
129
  import jmcomic # 导入此模块,需要先安装.
112
- jmcomic.download_album('422866') # 传入要下载的album的id,即可下载整个album到本地.
130
+ jmcomic.download_album('123') # 传入要下载的album的id,即可下载整个album到本地.
113
131
  ```
114
132
 
115
133
  上面的 `download_album`方法还有一个参数`option`,可用于控制下载配置,配置包括禁漫域名、网络代理、图片格式转换、插件等等。
@@ -138,8 +156,8 @@ import jmcomic
138
156
  # 创建配置对象
139
157
  option = jmcomic.create_option_by_file('你的配置文件路径,例如 D:/option.yml')
140
158
  # 使用option对象来下载本子
141
- jmcomic.download_album(422866, option)
142
- # 等价写法: option.download_album(422866)
159
+ jmcomic.download_album(123, option)
160
+ # 等价写法: option.download_album(123)
143
161
  ```
144
162
 
145
163
  ### 3. 使用命令行
@@ -149,10 +167,10 @@ jmcomic.download_album(422866, option)
149
167
 
150
168
  示例:
151
169
 
152
- 下载本子422866的命令
170
+ 下载本子123的命令
153
171
 
154
172
  ```sh
155
- jmcomic 422866
173
+ jmcomic 123
156
174
  ```
157
175
  同时下载本子123, 章节456的命令
158
176
  ```sh
@@ -1,14 +1,32 @@
1
- # Python API For JMComic (禁漫天堂)
1
+ <!-- 顶部标题 & 统计徽章 -->
2
+ <div align="center">
3
+ <h1 style="margin-top: 0" align="center">Python API for JMComic</h1>
4
+ <p align="center">
5
+ <strong>提供 Python API 访问禁漫天堂(网页端 & 移动端),集成 GitHub Actions 下载器🚀</strong>
6
+ </p>
2
7
 
3
- 本项目封装了一套可用于爬取JM的Python API.
8
+ [![GitHub](https://img.shields.io/badge/-GitHub-181717?logo=github)](https://github.com/hect0x7)
9
+ [![Stars](https://img.shields.io/github/stars/hect0x7/JMComic-Crawler-Python?color=orange&label=stars&style=flat)](https://github.com/hect0x7/JMComic-Crawler-Python/stargazers)
10
+ [![Forks](https://img.shields.io/github/forks/hect0x7/JMComic-Crawler-Python?color=green&label=forks&style=flat)](https://github.com/hect0x7/JMComic-Crawler-Python/forks)
11
+ [![GitHub latest releases](https://img.shields.io/github/v/release/hect0x7/JMComic-Crawler-Python?color=blue&label=version)](https://github.com/hect0x7/JMComic-Crawler-Python/releases/latest)
12
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/jmcomic?style=flat&color=hotpink)](https://pepy.tech/projects/jmcomic)
13
+ [![Licence](https://img.shields.io/github/license/hect0x7/JMComic-Crawler-Python?color=red)](https://github.com/hect0x7/JMComic-Crawler-Python)
4
14
 
5
- 你可以通过简单的几行Python代码,实现下载JM上的本子到本地,并且是处理好的图片。
15
+ </div>
16
+
17
+
18
+
19
+
20
+ > 本项目封装了一套可用于爬取JM的Python API.
21
+ >
22
+ > 你可以通过简单的几行Python代码,实现下载JM上的本子到本地,并且是处理好的图片。
23
+ >
24
+ > **友情提示:珍爱JM,为了减轻JM的服务器压力,请不要一次性爬取太多本子,西门🙏🙏🙏**.
6
25
 
7
26
  [【指路】教程:使用GitHub Actions下载禁漫本子](./assets/docs/sources/tutorial/1_github_actions.md)
8
27
 
9
28
  [【指路】教程:导出并下载你的禁漫收藏夹数据](./assets/docs/sources/tutorial/10_export_favorites.md)
10
29
 
11
- **友情提示:珍爱JM,为了减轻JM的服务器压力,请不要一次性爬取太多本子,西门🙏🙏🙏**.
12
30
 
13
31
  ## 项目介绍
14
32
 
@@ -47,11 +65,11 @@
47
65
 
48
66
  ### 1. 下载本子方法
49
67
 
50
- 只需要使用如下代码,就可以下载本子`JM422866`的所有章节的图片:
68
+ 只需要使用如下代码,就可以下载本子`JM123`的所有章节的图片:
51
69
 
52
70
  ```python
53
71
  import jmcomic # 导入此模块,需要先安装.
54
- jmcomic.download_album('422866') # 传入要下载的album的id,即可下载整个album到本地.
72
+ jmcomic.download_album('123') # 传入要下载的album的id,即可下载整个album到本地.
55
73
  ```
56
74
 
57
75
  上面的 `download_album`方法还有一个参数`option`,可用于控制下载配置,配置包括禁漫域名、网络代理、图片格式转换、插件等等。
@@ -80,8 +98,8 @@ import jmcomic
80
98
  # 创建配置对象
81
99
  option = jmcomic.create_option_by_file('你的配置文件路径,例如 D:/option.yml')
82
100
  # 使用option对象来下载本子
83
- jmcomic.download_album(422866, option)
84
- # 等价写法: option.download_album(422866)
101
+ jmcomic.download_album(123, option)
102
+ # 等价写法: option.download_album(123)
85
103
  ```
86
104
 
87
105
  ### 3. 使用命令行
@@ -91,10 +109,10 @@ jmcomic.download_album(422866, option)
91
109
 
92
110
  示例:
93
111
 
94
- 下载本子422866的命令
112
+ 下载本子123的命令
95
113
 
96
114
  ```sh
97
- jmcomic 422866
115
+ jmcomic 123
98
116
  ```
99
117
  同时下载本子123, 章节456的命令
100
118
  ```sh
@@ -2,7 +2,7 @@
2
2
  # 被依赖方 <--- 使用方
3
3
  # config <--- entity <--- toolkit <--- client <--- option <--- downloader
4
4
 
5
- __version__ = '2.6.10'
5
+ __version__ = '2.6.11'
6
6
 
7
7
  from .api import *
8
8
  from .jm_plugin import *
@@ -765,55 +765,17 @@ class JmApiClient(AbstractJmClient):
765
765
 
766
766
  def setting(self) -> JmApiResp:
767
767
  """
768
- 禁漫app的setting请求,返回如下内容(resp.res_data)
769
- {
770
- "logo_path": "https://cdn-msp.jmapiproxy1.monster/media/logo/new_logo.png",
771
- "main_web_host": "18-comic.work",
772
- "img_host": "https://cdn-msp.jmapiproxy1.monster",
773
- "base_url": "https://www.jmapinode.biz",
774
- "is_cn": 0,
775
- "cn_base_url": "https://www.jmapinode.biz",
776
- "version": "1.6.0",
777
- "test_version": "1.6.1",
778
- "store_link": "https://play.google.com/store/apps/details?id=com.jiaohua_browser",
779
- "ios_version": "1.6.0",
780
- "ios_test_version": "1.6.1",
781
- "ios_store_link": "https://18comic.vip/stray/",
782
- "ad_cache_version": 1698140798,
783
- "bundle_url": "https://18-comic.work/static/apk/patches1.6.0.zip",
784
- "is_hot_update": true,
785
- "api_banner_path": "https://cdn-msp.jmapiproxy1.monster/media/logo/channel_log.png?v=",
786
- "version_info": "\nAPP & IOS更新\nV1.6.0\n#禁漫 APK 更新拉!!\n更新調整以下項目\n1. 系統優化\n\nV1.5.9\n1. 跳錯誤新增 重試 網頁 按鈕\n2. 圖片讀取優化\n3.
787
- 線路調整優化\n\n無法順利更新或是系統題是有風險請使用下方\n下載點2\n有問題可以到DC群反饋\nhttps://discord.gg/V74p7HM\n",
788
- "app_shunts": [
789
- {
790
- "title": "圖源1",
791
- "key": 1
792
- },
793
- {
794
- "title": "圖源2",
795
- "key": 2
796
- },
797
- {
798
- "title": "圖源3",
799
- "key": 3
800
- },
801
- {
802
- "title": "圖源4",
803
- "key": 4
804
- }
805
- ],
806
- "download_url": "https://18-comic.work/static/apk/1.6.0.apk",
807
- "app_landing_page": "https://jm365.work/pXYbfA",
808
- "float_ad": true
809
- }
768
+ 禁漫app的setting请求
810
769
  """
811
770
  resp = self.req_api('/setting')
812
771
 
813
772
  # 检查禁漫最新的版本号
814
- setting_ver = str(resp.model_data.version)
773
+ setting_ver = str(resp.model_data.jm3_version)
815
774
  # 禁漫接口的版本 > jmcomic库内置版本
816
- if setting_ver > JmMagicConstants.APP_VERSION and JmModuleConfig.FLAG_USE_VERSION_NEWER_IF_BEHIND:
775
+ if (
776
+ JmModuleConfig.FLAG_USE_VERSION_NEWER_IF_BEHIND
777
+ and JmcomicText.compare_versions(setting_ver, JmMagicConstants.APP_VERSION) == 1
778
+ ):
817
779
  jm_log('api.setting', f'change APP_VERSION from [{JmMagicConstants.APP_VERSION}] to [{setting_ver}]')
818
780
  JmMagicConstants.APP_VERSION = setting_ver
819
781
 
@@ -959,10 +921,7 @@ class JmApiClient(AbstractJmClient):
959
921
 
960
922
  # 1. 检查是否 album_missing
961
923
  # json: {'code': 200, 'data': []}
962
- data = resp.model().data
963
- if isinstance(data, list) and len(data) == 0:
964
- ExceptionTool.raise_missing(resp, JmcomicText.parse_to_jm_id(url))
965
-
924
+ # 最新api已不存在这种情况,无需检查
966
925
  # 2. 是否是特殊的内容
967
926
  # 暂无
968
927
 
@@ -1007,7 +966,8 @@ class JmApiClient(AbstractJmClient):
1007
966
  def after_init(self):
1008
967
  # 自动更新禁漫API域名
1009
968
  if JmModuleConfig.FLAG_API_CLIENT_AUTO_UPDATE_DOMAIN:
1010
- self.update_api_domain()
969
+ new_server_list = self.fetch_latest_api_domain_for_module()
970
+ self.update_old_api_domain(new_server_list)
1011
971
 
1012
972
  # 保证拥有cookies,因为移动端要求必须携带cookies,否则会直接跳转同一本子【禁漫娘】
1013
973
  if JmModuleConfig.FLAG_API_CLIENT_REQUIRE_COOKIES:
@@ -1032,13 +992,19 @@ class JmApiClient(AbstractJmClient):
1032
992
  else:
1033
993
  return res_data['Server']
1034
994
 
1035
- def update_api_domain(self):
1036
- if True is JmModuleConfig.FLAG_API_CLIENT_AUTO_UPDATE_DOMAIN_DONE:
1037
- return
995
+ def update_old_api_domain(self, new_server_list: List[str]):
996
+ if new_server_list and sorted(self.domain_list) == sorted(JmModuleConfig.DOMAIN_API_LIST):
997
+ self.domain_list = new_server_list
998
+
999
+ def fetch_latest_api_domain_for_module(self):
1000
+ if JmModuleConfig.DOMAIN_API_UPDATED_LIST is not None:
1001
+ return JmModuleConfig.DOMAIN_API_UPDATED_LIST
1038
1002
 
1039
1003
  with self.client_update_domain_lock:
1040
- if True is JmModuleConfig.FLAG_API_CLIENT_AUTO_UPDATE_DOMAIN_DONE:
1041
- return
1004
+ # double check
1005
+ if JmModuleConfig.DOMAIN_API_UPDATED_LIST is not None:
1006
+ return JmModuleConfig.DOMAIN_API_UPDATED_LIST
1007
+
1042
1008
  # 遍历多个域名服务器
1043
1009
  for url in JmModuleConfig.API_URL_DOMAIN_SERVER_LIST:
1044
1010
  try:
@@ -1050,18 +1016,20 @@ class JmApiClient(AbstractJmClient):
1050
1016
  jm_log('api.update_domain.success',
1051
1017
  f'获取到最新的API域名,替换jmcomic内置域名:(new){new_server_list} ---→ (old){old_server_list}'
1052
1018
  )
1053
- # 更新域名
1054
- if sorted(self.domain_list) == sorted(old_server_list):
1055
- self.domain_list = new_server_list
1056
- JmModuleConfig.DOMAIN_API_LIST = new_server_list
1057
- break
1019
+ JmModuleConfig.DOMAIN_API_UPDATED_LIST = new_server_list
1020
+ return new_server_list
1058
1021
  except Exception as e:
1059
1022
  jm_log('api.update_domain.error',
1060
- f'通过[{url}]自动更新API域名失败,仍使用jmcomic内置域名。'
1023
+ f'通过[{url}]自动更新API域名失败,尝试下一个地址。'
1061
1024
  f'可通过代码[JmModuleConfig.FLAG_API_CLIENT_AUTO_UPDATE_DOMAIN=False]关闭自动更新API域名. 异常: {e}'
1062
1025
  )
1063
- # set done finally
1064
- JmModuleConfig.FLAG_API_CLIENT_AUTO_UPDATE_DOMAIN_DONE = True
1026
+ continue
1027
+
1028
+ # 走到这里,说明没有获取到域名更新
1029
+ # 为了本方法不被重复执行,把新域名字段修改为空列表
1030
+ # 空列表相当于一个done标识
1031
+ JmModuleConfig.DOMAIN_API_UPDATED_LIST = []
1032
+ return JmModuleConfig.DOMAIN_API_UPDATED_LIST
1065
1033
 
1066
1034
  client_init_cookies_lock = Lock()
1067
1035
 
@@ -122,18 +122,24 @@ class JmApiResp(JmJsonResp):
122
122
  def encoded_data(self) -> str:
123
123
  return self.json()['data']
124
124
 
125
+ def require_have_data(self):
126
+ data = self.encoded_data
127
+ if isinstance(data, list) and len(data) == 0 and self.json().get('errorMsg', None):
128
+ ExceptionTool.raises_resp(f'data返回值异常: {self.text}', self)
129
+
125
130
  @property
126
131
  def res_data(self) -> Any:
127
132
  self.require_success()
133
+ self.require_have_data()
128
134
  from json import loads
129
135
  return loads(self.decoded_data)
130
136
 
131
137
  @property
132
138
  def model_data(self) -> AdvancedDict:
133
139
  self.require_success()
140
+ self.require_have_data()
134
141
  return AdvancedDict(self.res_data)
135
142
 
136
-
137
143
  # album-comment
138
144
  class JmAlbumCommentResp(JmJsonResp):
139
145
 
@@ -77,7 +77,7 @@ class JmMagicConstants:
77
77
  APP_TOKEN_SECRET_2 = '18comicAPPContent'
78
78
  APP_DATA_SECRET = '185Hcomic3PAPP7R'
79
79
  API_DOMAIN_SERVER_SECRET = 'diosfjckwpqpdfjkvnqQjsik'
80
- APP_VERSION = '2.0.6'
80
+ APP_VERSION = '2.0.13'
81
81
 
82
82
 
83
83
  # 模块级别共用配置
@@ -134,6 +134,8 @@ class JmModuleConfig:
134
134
  www.cdnplaystation6.cc
135
135
  ''')
136
136
 
137
+ DOMAIN_API_UPDATED_LIST = None
138
+
137
139
  # 获取最新移动端API域名的地址
138
140
  API_URL_DOMAIN_SERVER_LIST = shuffled('''
139
141
  https://rup4a04-c01.tos-ap-southeast-1.bytepluses.com/newsvr-2025.txt
@@ -209,7 +211,6 @@ class JmModuleConfig:
209
211
  FLAG_API_CLIENT_REQUIRE_COOKIES = True
210
212
  # 自动更新禁漫API域名
211
213
  FLAG_API_CLIENT_AUTO_UPDATE_DOMAIN = True
212
- FLAG_API_CLIENT_AUTO_UPDATE_DOMAIN_DONE = None
213
214
  # log开关标记
214
215
  FLAG_ENABLE_JM_LOG = True
215
216
  # log时解码url
@@ -130,9 +130,9 @@ class DirRule:
130
130
  @classmethod
131
131
  def parse_f_string_rule(cls, album, photo, rule: str):
132
132
  properties = {}
133
- if album:
133
+ if album is not None:
134
134
  properties.update(album.get_properties_dict())
135
- if photo:
135
+ if photo is not None:
136
136
  properties.update(photo.get_properties_dict())
137
137
  return rule.format(**properties)
138
138
 
@@ -414,6 +414,22 @@ class JmcomicText:
414
414
  path = f'/media/albums/{cls.parse_to_jm_id(album_id)}{size}.jpg'
415
415
  return cls.format_url(path, image_domain)
416
416
 
417
+ @classmethod
418
+ def compare_versions(cls, v1: str, v2: str) -> int:
419
+ parts1 = list(map(int, v1.split(".")))
420
+ parts2 = list(map(int, v2.split(".")))
421
+
422
+ # 补齐长度
423
+ length = max(len(parts1), len(parts2))
424
+ parts1 += [0] * (length - len(parts1))
425
+ parts2 += [0] * (length - len(parts2))
426
+
427
+ if parts1 > parts2:
428
+ return 1 # v1 大
429
+ elif parts1 < parts2:
430
+ return -1 # v2 大
431
+ else:
432
+ return 0 # 相等
417
433
 
418
434
  # 支持dsl: #{???} -> os.getenv(???)
419
435
  JmcomicText.dsl_replacer.add_dsl_and_replacer(r'\$\{(.*?)\}', JmcomicText.match_os_env)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jmcomic
3
- Version: 2.6.10
3
+ Version: 2.6.11
4
4
  Summary: Python API For JMComic (禁漫天堂)
5
5
  Home-page: https://github.com/hect0x7/JMComic-Crawler-Python
6
6
  Author: hect0x7
@@ -56,17 +56,35 @@ Dynamic: home-page
56
56
  Dynamic: license-file
57
57
  Dynamic: requires-python
58
58
 
59
- # Python API For JMComic (禁漫天堂)
59
+ <!-- 顶部标题 & 统计徽章 -->
60
+ <div align="center">
61
+ <h1 style="margin-top: 0" align="center">Python API for JMComic</h1>
62
+ <p align="center">
63
+ <strong>提供 Python API 访问禁漫天堂(网页端 & 移动端),集成 GitHub Actions 下载器🚀</strong>
64
+ </p>
60
65
 
61
- 本项目封装了一套可用于爬取JM的Python API.
66
+ [![GitHub](https://img.shields.io/badge/-GitHub-181717?logo=github)](https://github.com/hect0x7)
67
+ [![Stars](https://img.shields.io/github/stars/hect0x7/JMComic-Crawler-Python?color=orange&label=stars&style=flat)](https://github.com/hect0x7/JMComic-Crawler-Python/stargazers)
68
+ [![Forks](https://img.shields.io/github/forks/hect0x7/JMComic-Crawler-Python?color=green&label=forks&style=flat)](https://github.com/hect0x7/JMComic-Crawler-Python/forks)
69
+ [![GitHub latest releases](https://img.shields.io/github/v/release/hect0x7/JMComic-Crawler-Python?color=blue&label=version)](https://github.com/hect0x7/JMComic-Crawler-Python/releases/latest)
70
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/jmcomic?style=flat&color=hotpink)](https://pepy.tech/projects/jmcomic)
71
+ [![Licence](https://img.shields.io/github/license/hect0x7/JMComic-Crawler-Python?color=red)](https://github.com/hect0x7/JMComic-Crawler-Python)
62
72
 
63
- 你可以通过简单的几行Python代码,实现下载JM上的本子到本地,并且是处理好的图片。
73
+ </div>
74
+
75
+
76
+
77
+
78
+ > 本项目封装了一套可用于爬取JM的Python API.
79
+ >
80
+ > 你可以通过简单的几行Python代码,实现下载JM上的本子到本地,并且是处理好的图片。
81
+ >
82
+ > **友情提示:珍爱JM,为了减轻JM的服务器压力,请不要一次性爬取太多本子,西门🙏🙏🙏**.
64
83
 
65
84
  [【指路】教程:使用GitHub Actions下载禁漫本子](./assets/docs/sources/tutorial/1_github_actions.md)
66
85
 
67
86
  [【指路】教程:导出并下载你的禁漫收藏夹数据](./assets/docs/sources/tutorial/10_export_favorites.md)
68
87
 
69
- **友情提示:珍爱JM,为了减轻JM的服务器压力,请不要一次性爬取太多本子,西门🙏🙏🙏**.
70
88
 
71
89
  ## 项目介绍
72
90
 
@@ -105,11 +123,11 @@ Dynamic: requires-python
105
123
 
106
124
  ### 1. 下载本子方法
107
125
 
108
- 只需要使用如下代码,就可以下载本子`JM422866`的所有章节的图片:
126
+ 只需要使用如下代码,就可以下载本子`JM123`的所有章节的图片:
109
127
 
110
128
  ```python
111
129
  import jmcomic # 导入此模块,需要先安装.
112
- jmcomic.download_album('422866') # 传入要下载的album的id,即可下载整个album到本地.
130
+ jmcomic.download_album('123') # 传入要下载的album的id,即可下载整个album到本地.
113
131
  ```
114
132
 
115
133
  上面的 `download_album`方法还有一个参数`option`,可用于控制下载配置,配置包括禁漫域名、网络代理、图片格式转换、插件等等。
@@ -138,8 +156,8 @@ import jmcomic
138
156
  # 创建配置对象
139
157
  option = jmcomic.create_option_by_file('你的配置文件路径,例如 D:/option.yml')
140
158
  # 使用option对象来下载本子
141
- jmcomic.download_album(422866, option)
142
- # 等价写法: option.download_album(422866)
159
+ jmcomic.download_album(123, option)
160
+ # 等价写法: option.download_album(123)
143
161
  ```
144
162
 
145
163
  ### 3. 使用命令行
@@ -149,10 +167,10 @@ jmcomic.download_album(422866, option)
149
167
 
150
168
  示例:
151
169
 
152
- 下载本子422866的命令
170
+ 下载本子123的命令
153
171
 
154
172
  ```sh
155
- jmcomic 422866
173
+ jmcomic 123
156
174
  ```
157
175
  同时下载本子123, 章节456的命令
158
176
  ```sh
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes