plugin-jm-server 0.2.3__tar.gz → 0.2.4__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 (67) hide show
  1. plugin_jm_server-0.2.4/PKG-INFO +34 -0
  2. plugin_jm_server-0.2.4/plugin_jm_server/__init__.py +21 -0
  3. plugin_jm_server-0.2.4/plugin_jm_server.egg-info/PKG-INFO +34 -0
  4. plugin_jm_server-0.2.4/plugin_jm_server.egg-info/SOURCES.txt +7 -0
  5. plugin_jm_server-0.2.4/plugin_jm_server.egg-info/requires.txt +1 -0
  6. plugin_jm_server-0.2.4/setup.py +43 -0
  7. plugin_jm_server-0.2.3/PKG-INFO +0 -202
  8. plugin_jm_server-0.2.3/README.md +0 -166
  9. plugin_jm_server-0.2.3/setup.py +0 -60
  10. plugin_jm_server-0.2.3/src/plugin_jm_server/__init__.py +0 -3
  11. plugin_jm_server-0.2.3/src/plugin_jm_server/__main__.py +0 -5
  12. plugin_jm_server-0.2.3/src/plugin_jm_server/app.py +0 -511
  13. plugin_jm_server-0.2.3/src/plugin_jm_server/cli.py +0 -154
  14. plugin_jm_server-0.2.3/src/plugin_jm_server/driver.py +0 -95
  15. plugin_jm_server-0.2.3/src/plugin_jm_server/files.py +0 -175
  16. plugin_jm_server-0.2.3/src/plugin_jm_server/message.py +0 -135
  17. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/all.min.css +0 -5
  18. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/bootstrap.css +0 -7770
  19. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/download_error.css +0 -79
  20. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/h5/m_download_error.css +0 -91
  21. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/h5/m_index.css +0 -146
  22. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/h5/m_login.css +0 -107
  23. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/h5/m_message.css +0 -476
  24. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/h5/m_upload.css +0 -179
  25. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/h5/normalize.css +0 -349
  26. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/index.css +0 -729
  27. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/index_spa.css +0 -637
  28. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/login.css +0 -118
  29. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/message.css +0 -516
  30. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/style_photo.css +0 -1
  31. plugin_jm_server-0.2.3/src/plugin_jm_server/static/css/upload.css +0 -161
  32. plugin_jm_server-0.2.3/src/plugin_jm_server/static/img/bg.jpg +0 -0
  33. plugin_jm_server-0.2.3/src/plugin_jm_server/static/img/m_bg.jpeg +0 -0
  34. plugin_jm_server-0.2.3/src/plugin_jm_server/static/js/common.js +0 -195
  35. plugin_jm_server-0.2.3/src/plugin_jm_server/static/js/h5/m_index.js +0 -39
  36. plugin_jm_server-0.2.3/src/plugin_jm_server/static/js/h5/m_upload.js +0 -72
  37. plugin_jm_server-0.2.3/src/plugin_jm_server/static/js/index.js +0 -321
  38. plugin_jm_server-0.2.3/src/plugin_jm_server/static/js/index_spa.js +0 -896
  39. plugin_jm_server-0.2.3/src/plugin_jm_server/static/js/jquery-3.7.1.min.js +0 -2
  40. plugin_jm_server-0.2.3/src/plugin_jm_server/static/js/jquery.album-0.2.js +0 -8
  41. plugin_jm_server-0.2.3/src/plugin_jm_server/static/js/jquery.lazyload-2.0.js +0 -444
  42. plugin_jm_server-0.2.3/src/plugin_jm_server/static/js/jquery.photo-0.3.js +0 -427
  43. plugin_jm_server-0.2.3/src/plugin_jm_server/static/js/message.js +0 -301
  44. plugin_jm_server-0.2.3/src/plugin_jm_server/static/js/upload.js +0 -72
  45. plugin_jm_server-0.2.3/src/plugin_jm_server/static/webfonts/fa-regular-400.woff2 +0 -0
  46. plugin_jm_server-0.2.3/src/plugin_jm_server/static/webfonts/fa-solid-900.woff2 +0 -0
  47. plugin_jm_server-0.2.3/src/plugin_jm_server/templates/download_error.html +0 -28
  48. plugin_jm_server-0.2.3/src/plugin_jm_server/templates/index.html +0 -216
  49. plugin_jm_server-0.2.3/src/plugin_jm_server/templates/index_spa.html +0 -144
  50. plugin_jm_server-0.2.3/src/plugin_jm_server/templates/jm_view.html +0 -132
  51. plugin_jm_server-0.2.3/src/plugin_jm_server/templates/login.html +0 -40
  52. plugin_jm_server-0.2.3/src/plugin_jm_server/templates/m_download_error.html +0 -28
  53. plugin_jm_server-0.2.3/src/plugin_jm_server/templates/m_index.html +0 -214
  54. plugin_jm_server-0.2.3/src/plugin_jm_server/templates/m_jm_view.html +0 -128
  55. plugin_jm_server-0.2.3/src/plugin_jm_server/templates/m_login.html +0 -43
  56. plugin_jm_server-0.2.3/src/plugin_jm_server/templates/m_message.html +0 -84
  57. plugin_jm_server-0.2.3/src/plugin_jm_server/templates/m_upload.html +0 -46
  58. plugin_jm_server-0.2.3/src/plugin_jm_server/templates/message.html +0 -91
  59. plugin_jm_server-0.2.3/src/plugin_jm_server/templates/upload.html +0 -47
  60. plugin_jm_server-0.2.3/src/plugin_jm_server.egg-info/PKG-INFO +0 -202
  61. plugin_jm_server-0.2.3/src/plugin_jm_server.egg-info/SOURCES.txt +0 -59
  62. plugin_jm_server-0.2.3/src/plugin_jm_server.egg-info/entry_points.txt +0 -2
  63. plugin_jm_server-0.2.3/src/plugin_jm_server.egg-info/requires.txt +0 -4
  64. plugin_jm_server-0.2.3/tests/test_cli.py +0 -104
  65. {plugin_jm_server-0.2.3/src → plugin_jm_server-0.2.4}/plugin_jm_server.egg-info/dependency_links.txt +0 -0
  66. {plugin_jm_server-0.2.3/src → plugin_jm_server-0.2.4}/plugin_jm_server.egg-info/top_level.txt +0 -0
  67. {plugin_jm_server-0.2.3 → plugin_jm_server-0.2.4}/setup.cfg +0 -0
@@ -0,0 +1,34 @@
1
+ Metadata-Version: 2.4
2
+ Name: plugin_jm_server
3
+ Version: 0.2.4
4
+ Summary: [DEPRECATED] Renamed to jm-view-server. Installs jm-view-server and forwards to it.
5
+ Home-page: https://github.com/hect0x7/jm-view-server
6
+ Author: hect0x7
7
+ Author-email: 93357912+hect0x7@users.noreply.github.com
8
+ Keywords: python,jmcomic,jm-view-server,18comic,禁漫天堂,NSFW,deprecated
9
+ Classifier: Development Status :: 7 - Inactive
10
+ Requires-Python: >=3.7
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: jm-view-server
13
+ Dynamic: author
14
+ Dynamic: author-email
15
+ Dynamic: classifier
16
+ Dynamic: description
17
+ Dynamic: description-content-type
18
+ Dynamic: home-page
19
+ Dynamic: keywords
20
+ Dynamic: requires-dist
21
+ Dynamic: requires-python
22
+ Dynamic: summary
23
+
24
+ # plugin_jm_server 已更名
25
+
26
+ 本包已更名为 **jm-view-server**,此处仅保留为兼容旧用户的重定向薄壳。
27
+
28
+ 请改用:
29
+
30
+ ```shell
31
+ pip install jm-view-server
32
+ ```
33
+
34
+ `import jm_view_server` 代替 `import plugin_jm_server`;CLI 命令 `jms` 与 jmcomic 插件 key `jm_server` 保持不变。
@@ -0,0 +1,21 @@
1
+ """
2
+ [已弃用] plugin_jm_server 已更名为 jm_view_server。
3
+
4
+ 本包仅为兼容旧用户保留,内部转发到新包 jm_view_server。
5
+ 请尽快改用: pip install jm-view-server, 并把 import 从
6
+ `plugin_jm_server` 改为 `jm_view_server`。CLI 命令 `jms` 与
7
+ jmcomic 插件 key `jm_server` 均保持不变。
8
+ """
9
+ import warnings
10
+
11
+ warnings.warn(
12
+ "plugin_jm_server 已更名为 jm_view_server,请改用 "
13
+ "`pip install jm-view-server` 并 `import jm_view_server`。"
14
+ "本包将在后续版本停止维护。",
15
+ DeprecationWarning,
16
+ stacklevel=2,
17
+ )
18
+
19
+ # 转发新包的公共 API 与版本,保证 `from plugin_jm_server import JmServer` 等旧用法可用
20
+ from jm_view_server import * # noqa: F401,F403
21
+ from jm_view_server import __version__ # noqa: F401
@@ -0,0 +1,34 @@
1
+ Metadata-Version: 2.4
2
+ Name: plugin_jm_server
3
+ Version: 0.2.4
4
+ Summary: [DEPRECATED] Renamed to jm-view-server. Installs jm-view-server and forwards to it.
5
+ Home-page: https://github.com/hect0x7/jm-view-server
6
+ Author: hect0x7
7
+ Author-email: 93357912+hect0x7@users.noreply.github.com
8
+ Keywords: python,jmcomic,jm-view-server,18comic,禁漫天堂,NSFW,deprecated
9
+ Classifier: Development Status :: 7 - Inactive
10
+ Requires-Python: >=3.7
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: jm-view-server
13
+ Dynamic: author
14
+ Dynamic: author-email
15
+ Dynamic: classifier
16
+ Dynamic: description
17
+ Dynamic: description-content-type
18
+ Dynamic: home-page
19
+ Dynamic: keywords
20
+ Dynamic: requires-dist
21
+ Dynamic: requires-python
22
+ Dynamic: summary
23
+
24
+ # plugin_jm_server 已更名
25
+
26
+ 本包已更名为 **jm-view-server**,此处仅保留为兼容旧用户的重定向薄壳。
27
+
28
+ 请改用:
29
+
30
+ ```shell
31
+ pip install jm-view-server
32
+ ```
33
+
34
+ `import jm_view_server` 代替 `import plugin_jm_server`;CLI 命令 `jms` 与 jmcomic 插件 key `jm_server` 保持不变。
@@ -0,0 +1,7 @@
1
+ setup.py
2
+ plugin_jm_server/__init__.py
3
+ plugin_jm_server.egg-info/PKG-INFO
4
+ plugin_jm_server.egg-info/SOURCES.txt
5
+ plugin_jm_server.egg-info/dependency_links.txt
6
+ plugin_jm_server.egg-info/requires.txt
7
+ plugin_jm_server.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ jm-view-server
@@ -0,0 +1,43 @@
1
+ """
2
+ 旧包 plugin_jm_server 的打包脚本(重定向薄壳)。
3
+
4
+ 单独发布, 与主包 jm-view-server 互不干扰:
5
+ cd legacy_shim && python -m build && twine upload dist/*
6
+
7
+ 作用: 装了旧包名的用户 `pip install plugin_jm_server` 时,
8
+ 会自动带上新包 jm-view-server, 且旧的 import / `jms` 命令仍可用,
9
+ 运行时打印 DeprecationWarning 引导迁移。
10
+ """
11
+ from setuptools import setup, find_packages
12
+
13
+ setup(
14
+ name='plugin_jm_server',
15
+ version='0.2.4',
16
+ description='[DEPRECATED] Renamed to jm-view-server. Installs jm-view-server and forwards to it.',
17
+ long_description=(
18
+ '# plugin_jm_server 已更名\n\n'
19
+ '本包已更名为 **jm-view-server**,此处仅保留为兼容旧用户的重定向薄壳。\n\n'
20
+ '请改用:\n\n'
21
+ '```shell\n'
22
+ 'pip install jm-view-server\n'
23
+ '```\n\n'
24
+ '`import jm_view_server` 代替 `import plugin_jm_server`;'
25
+ 'CLI 命令 `jms` 与 jmcomic 插件 key `jm_server` 保持不变。\n'
26
+ ),
27
+ long_description_content_type="text/markdown",
28
+ url='https://github.com/hect0x7/jm-view-server',
29
+ author='hect0x7',
30
+ author_email='93357912+hect0x7@users.noreply.github.com',
31
+ packages=find_packages(),
32
+ python_requires=">=3.7",
33
+ # 关键: 安装旧包自动带上新包
34
+ install_requires=[
35
+ 'jm-view-server',
36
+ ],
37
+ keywords=['python', 'jmcomic', 'jm-view-server', '18comic', '禁漫天堂', 'NSFW', 'deprecated'],
38
+ classifiers=[
39
+ "Development Status :: 7 - Inactive",
40
+ ],
41
+ # 不注册 jms 命令: jms 始终由主包 jm-view-server 提供,
42
+ # 避免同时安装两个包时旧包覆盖主包、导致每次都弹弃用告警。
43
+ )
@@ -1,202 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: plugin_jm_server
3
- Version: 0.2.3
4
- Summary: plugin_jm_server, a plugin for jmcomic that can be used to view comics in a web browser.
5
- Home-page: https://github.com/hect0x7/plugin-jm-server
6
- Author: hect0x7
7
- Author-email: 93357912+hect0x7@users.noreply.github.com
8
- Keywords: python,jmcomic,18comic,禁漫天堂,NSFW
9
- Classifier: Development Status :: 4 - Beta
10
- Classifier: Intended Audience :: Developers
11
- Classifier: Programming Language :: Python :: 3.7
12
- Classifier: Programming Language :: Python :: 3.8
13
- Classifier: Programming Language :: Python :: 3.9
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Operating System :: MacOS
18
- Classifier: Operating System :: POSIX :: Linux
19
- Classifier: Operating System :: Microsoft :: Windows
20
- Requires-Python: >=3.7
21
- Description-Content-Type: text/markdown
22
- Requires-Dist: jmcomic
23
- Requires-Dist: flask
24
- Requires-Dist: psutil
25
- Requires-Dist: cryptography
26
- Dynamic: author
27
- Dynamic: author-email
28
- Dynamic: classifier
29
- Dynamic: description
30
- Dynamic: description-content-type
31
- Dynamic: home-page
32
- Dynamic: keywords
33
- Dynamic: requires-dist
34
- Dynamic: requires-python
35
- Dynamic: summary
36
-
37
- <!-- 顶部标题 & 统计徽章 -->
38
- <div align="center">
39
- <img src="images/logo.png" width="180" alt="plugin-jm-server logo">
40
- <h1 style="margin-top: 15px" align="center">plugin-jm-server</h1>
41
-
42
- <p align="center">
43
- <strong>“离线版”禁漫天堂,你的纯本地 离线看本神器!</strong>
44
- </p>
45
-
46
- [![GitHub](https://img.shields.io/badge/-GitHub-181717?logo=github)](https://github.com/hect0x7)
47
- [![Stars](https://img.shields.io/github/stars/hect0x7/plugin-jm-server?color=orange&label=stars&style=flat)](https://github.com/hect0x7/plugin-jm-server/stargazers)
48
- [![Forks](https://img.shields.io/github/forks/hect0x7/plugin-jm-server?color=green&label=forks&style=flat)](https://github.com/hect0x7/plugin-jm-server/forks)
49
- [![PyPI](https://img.shields.io/pypi/v/plugin-jm-server?color=blue&label=version)](https://pypi.org/project/plugin-jm-server/)
50
- [![PyPI - Downloads](https://img.shields.io/pypi/dm/plugin-jm-server?style=flat&color=hotpink)](https://pepy.tech/projects/plugin-jm-server)
51
- [![Licence](https://img.shields.io/github/license/hect0x7/plugin-jm-server?color=red)](https://github.com/hect0x7/plugin-jm-server)
52
-
53
- </div>
54
-
55
- > 该项目会在你的电脑上启动一个**本地文件服务器**。你可以直接在浏览器(手机或电脑)中打开它,它会把本地文件夹里的图片转换成类似“禁漫天堂”的章节观看页面。
56
- >
57
- > **核心优势**:
58
- > - 支持各种强大的浏览器插件和脚本,例如[双页阅读插件](https://sleazyfork.org/zh-CN/scripts/374903-comicread)。
59
- > - 一键开启局域网共享,电脑下载,躺在床上用手机看。
60
-
61
- ![架构与流程图](https://raw.githubusercontent.com/hect0x7/hect0x7/master/images/jmcomic-intro-main.png)
62
-
63
- ---
64
-
65
- ## 🌟 功能与界面展示
66
-
67
- 本项目不仅提供了简单的文件浏览,还专为漫画阅读进行了深度优化:
68
-
69
- ### 1. 智能资源管理(文件夹浏览页)
70
- - **路径导航**:输入框自动补全路径,快速定位。
71
- - **封面预览**:鼠标悬停在文件夹上,自动展示首张图片作为封面。
72
- - **书签收藏**:将常看目录加入左侧书签,方便下次访问。
73
-
74
- ![](images/4.png)
75
- *(电脑端:文件夹与看本二合一模式)* ![](images/8.png)
76
- *(手机端:文件夹列表)* ![](images/2.png)
77
-
78
- ### 2. 沉浸式阅读体验(看本模式)
79
- - **懒加载极速浏览**:哪怕一个章节有几百张高清大图,也能秒开且不卡顿。
80
- - **多端适配**:无论是在宽屏显示器还是手机触摸屏上,都有最舒适的阅读排版。
81
- - **快捷交互**:支持键盘翻页、浮动工具栏快速回到顶部等。
82
-
83
- *(电脑端:看本模式)* ![](images/5.png)
84
- *(手机端:看本模式)* ![](images/7.jpeg)
85
-
86
- ### 3. 局域网消息与隐私保护
87
- - **消息中心**:电脑和手机在局域网内可互传文本消息,实时弹窗提醒(v0.2.2+ 新功能)。
88
- - **密码验证**:支持设置访问密码,防止同处局域网的其他室友/家人偷看!
89
-
90
- *(局域网消息界面)* ![](images/9.png)
91
- *(登录密码验证)* ![](images/3.png)
92
-
93
- ---
94
-
95
- ## 🚀 小白快速上手指南
96
-
97
- 如果你不懂编程,请严格按照以下两步操作即可:
98
-
99
- ### 第一步:环境准备
100
- 本项目基于 Python 开发,因此你的电脑必须先安装 Python。
101
- - 请前往 [Python 官网](https://www.python.org/downloads/) 下载并安装最新版 Python(安装时请务必勾选 `Add Python to PATH`)。
102
-
103
- ### 第二步:一键安装与启动
104
- 打开你电脑的**命令行终端**(Windows 下按 `Win+R` 输入 `cmd`,Mac 下打开“终端”APP),复制并执行下面这行命令:
105
-
106
- ```shell
107
- pip install plugin_jm_server && jms
108
- ```
109
-
110
- > **提示**:这行命令会帮你自动下载安装必要的组件,并以默认配置(分享当前所在目录、端口80)启动服务器。
111
-
112
- **启动成功后怎么用?**
113
- 终端里会打印出两行地址,例如:
114
- - 本机访问:`http://127.0.0.1:80`
115
- - 局域网访问:`http://192.168.1.100:80`
116
-
117
- 你只需要在电脑的浏览器里打开第一个地址,或者在连着同一个 WiFi 的手机浏览器里打开第二个地址,就可以开始看漫画了!
118
-
119
- > **提示**:如果在终端没看清局域网地址也没关系,当你用电脑打开本机地址后,**网页的主页顶部也会直接显示并智能识别当前的局域网地址**,你可以一键复制发给手机直接访问。
120
-
121
- ---
122
-
123
- ## ⚙️ 进阶使用(针对有经验的用户)
124
-
125
- 安装后系统会注册 `jms` 命令,无需写代码即可通过丰富的参数进行个性化启动:
126
-
127
- ```shell
128
- # 共享指定目录 ~/comics,并使用 8080 端口(高位端口无需管理员权限)
129
- jms ~/comics -p 8080
130
-
131
- # 设置登录密码为 123,并启用 HTTPS
132
- jms ~/comics -P 123 -s
133
-
134
- # 仅允许指定 IP 的设备访问
135
- jms ~/comics --ip-whitelist 192.168.1.10,192.168.1.11
136
-
137
- # 加载 jmcomic 配置开启在线下载
138
- jms ~/comics -o op.yml
139
- ```
140
-
141
- **全部参数说明(可通过 `jms -h` 查看):**
142
- | 参数 | 说明 | 默认值 |
143
- | --- | --- | --- |
144
- | `path` | 要共享的根目录(位置参数) | 当前目录 |
145
- | `-P, --password` | 登录密码,空表示免密 | 空 |
146
- | `-H, --host` | 监听地址 | `0.0.0.0` |
147
- | `-p, --port` | 监听端口 | `80` |
148
- | `-s, --ssl` | 启用 HTTPS(adhoc 自签名) | 关闭 |
149
- | `-o, --option` | [jmcomic](https://github.com/hect0x7/JMComic-Crawler-Python) 配置文件路径,开启在线下载 | 无 |
150
- | `--ip-whitelist` | IP 白名单,逗号分隔 | 不限制 |
151
- | `--current-path` | 初始当前路径 | 同 `path` |
152
- | `-e, --env` | 设置环境变量 `KEY=VALUE`,可重复 | 无 |
153
- | `--debug` | 开启 Flask debug 模式 | 关闭 |
154
-
155
- > 注:如果你在 Linux/macOS 上启动报错没有权限,是因为绑定默认的 80 端口需要管理员权限。建议加上 `-p 8080` 参数改用其他端口。
156
-
157
- ---
158
-
159
- ## 👨‍💻 开发者专属区域
160
-
161
- 如果你想在自己的 Python 脚本中集成或二次开发该服务,可以通过代码进行调用。
162
-
163
- ### 1. HTTP / HTTPS 原生调用
164
- ```python
165
- from plugin_jm_server import *
166
-
167
- # 启动 HTTP 服务
168
- server = JmServer('D:/', 'password')
169
- server.run(host='0.0.0.0', port=80)
170
-
171
- # 启动 HTTPS 服务 (需要安装 cryptography)
172
- server.run(host='0.0.0.0', port=443, ssl_context='adhoc')
173
- ```
174
-
175
- ### 2. 作为 jmcomic 的插件集成
176
- 你可以在 `jmcomic` 的 `op.yml` 配置文件中配置它:
177
- ```yml
178
- plugins:
179
- after_init:
180
- - plugin: jm_server
181
- kwargs:
182
- password: ''
183
- ```
184
- 对应的启动脚本注意事项:
185
- ```python
186
- from jmcomic import *
187
-
188
- op = create_option('op.yml')
189
- op.download_album(123)
190
-
191
- # 注意:虽然爬虫主线程执行完毕,但 Web 服务器线程仍在运行中。
192
- # 需要用户手动按 Ctrl+C 退出。
193
- # Python 3.12+ 特别注意:必须插入下面这行代码,Web 服务器才能继续处理请求!
194
- op.wait_all_plugins_finish()
195
- ```
196
-
197
- ---
198
-
199
- ## 💡 想法起源
200
-
201
- - 想法起源:https://github.com/hect0x7/JMComic-Crawler-Python/issues/192
202
- - UI 与部分基础架构参考:https://github.com/AiCorein/Flask-Files-Server
@@ -1,166 +0,0 @@
1
- <!-- 顶部标题 & 统计徽章 -->
2
- <div align="center">
3
- <img src="images/logo.png" width="180" alt="plugin-jm-server logo">
4
- <h1 style="margin-top: 15px" align="center">plugin-jm-server</h1>
5
-
6
- <p align="center">
7
- <strong>“离线版”禁漫天堂,你的纯本地 离线看本神器!</strong>
8
- </p>
9
-
10
- [![GitHub](https://img.shields.io/badge/-GitHub-181717?logo=github)](https://github.com/hect0x7)
11
- [![Stars](https://img.shields.io/github/stars/hect0x7/plugin-jm-server?color=orange&label=stars&style=flat)](https://github.com/hect0x7/plugin-jm-server/stargazers)
12
- [![Forks](https://img.shields.io/github/forks/hect0x7/plugin-jm-server?color=green&label=forks&style=flat)](https://github.com/hect0x7/plugin-jm-server/forks)
13
- [![PyPI](https://img.shields.io/pypi/v/plugin-jm-server?color=blue&label=version)](https://pypi.org/project/plugin-jm-server/)
14
- [![PyPI - Downloads](https://img.shields.io/pypi/dm/plugin-jm-server?style=flat&color=hotpink)](https://pepy.tech/projects/plugin-jm-server)
15
- [![Licence](https://img.shields.io/github/license/hect0x7/plugin-jm-server?color=red)](https://github.com/hect0x7/plugin-jm-server)
16
-
17
- </div>
18
-
19
- > 该项目会在你的电脑上启动一个**本地文件服务器**。你可以直接在浏览器(手机或电脑)中打开它,它会把本地文件夹里的图片转换成类似“禁漫天堂”的章节观看页面。
20
- >
21
- > **核心优势**:
22
- > - 支持各种强大的浏览器插件和脚本,例如[双页阅读插件](https://sleazyfork.org/zh-CN/scripts/374903-comicread)。
23
- > - 一键开启局域网共享,电脑下载,躺在床上用手机看。
24
-
25
- ![架构与流程图](https://raw.githubusercontent.com/hect0x7/hect0x7/master/images/jmcomic-intro-main.png)
26
-
27
- ---
28
-
29
- ## 🌟 功能与界面展示
30
-
31
- 本项目不仅提供了简单的文件浏览,还专为漫画阅读进行了深度优化:
32
-
33
- ### 1. 智能资源管理(文件夹浏览页)
34
- - **路径导航**:输入框自动补全路径,快速定位。
35
- - **封面预览**:鼠标悬停在文件夹上,自动展示首张图片作为封面。
36
- - **书签收藏**:将常看目录加入左侧书签,方便下次访问。
37
-
38
- ![](images/4.png)
39
- *(电脑端:文件夹与看本二合一模式)* ![](images/8.png)
40
- *(手机端:文件夹列表)* ![](images/2.png)
41
-
42
- ### 2. 沉浸式阅读体验(看本模式)
43
- - **懒加载极速浏览**:哪怕一个章节有几百张高清大图,也能秒开且不卡顿。
44
- - **多端适配**:无论是在宽屏显示器还是手机触摸屏上,都有最舒适的阅读排版。
45
- - **快捷交互**:支持键盘翻页、浮动工具栏快速回到顶部等。
46
-
47
- *(电脑端:看本模式)* ![](images/5.png)
48
- *(手机端:看本模式)* ![](images/7.jpeg)
49
-
50
- ### 3. 局域网消息与隐私保护
51
- - **消息中心**:电脑和手机在局域网内可互传文本消息,实时弹窗提醒(v0.2.2+ 新功能)。
52
- - **密码验证**:支持设置访问密码,防止同处局域网的其他室友/家人偷看!
53
-
54
- *(局域网消息界面)* ![](images/9.png)
55
- *(登录密码验证)* ![](images/3.png)
56
-
57
- ---
58
-
59
- ## 🚀 小白快速上手指南
60
-
61
- 如果你不懂编程,请严格按照以下两步操作即可:
62
-
63
- ### 第一步:环境准备
64
- 本项目基于 Python 开发,因此你的电脑必须先安装 Python。
65
- - 请前往 [Python 官网](https://www.python.org/downloads/) 下载并安装最新版 Python(安装时请务必勾选 `Add Python to PATH`)。
66
-
67
- ### 第二步:一键安装与启动
68
- 打开你电脑的**命令行终端**(Windows 下按 `Win+R` 输入 `cmd`,Mac 下打开“终端”APP),复制并执行下面这行命令:
69
-
70
- ```shell
71
- pip install plugin_jm_server && jms
72
- ```
73
-
74
- > **提示**:这行命令会帮你自动下载安装必要的组件,并以默认配置(分享当前所在目录、端口80)启动服务器。
75
-
76
- **启动成功后怎么用?**
77
- 终端里会打印出两行地址,例如:
78
- - 本机访问:`http://127.0.0.1:80`
79
- - 局域网访问:`http://192.168.1.100:80`
80
-
81
- 你只需要在电脑的浏览器里打开第一个地址,或者在连着同一个 WiFi 的手机浏览器里打开第二个地址,就可以开始看漫画了!
82
-
83
- > **提示**:如果在终端没看清局域网地址也没关系,当你用电脑打开本机地址后,**网页的主页顶部也会直接显示并智能识别当前的局域网地址**,你可以一键复制发给手机直接访问。
84
-
85
- ---
86
-
87
- ## ⚙️ 进阶使用(针对有经验的用户)
88
-
89
- 安装后系统会注册 `jms` 命令,无需写代码即可通过丰富的参数进行个性化启动:
90
-
91
- ```shell
92
- # 共享指定目录 ~/comics,并使用 8080 端口(高位端口无需管理员权限)
93
- jms ~/comics -p 8080
94
-
95
- # 设置登录密码为 123,并启用 HTTPS
96
- jms ~/comics -P 123 -s
97
-
98
- # 仅允许指定 IP 的设备访问
99
- jms ~/comics --ip-whitelist 192.168.1.10,192.168.1.11
100
-
101
- # 加载 jmcomic 配置开启在线下载
102
- jms ~/comics -o op.yml
103
- ```
104
-
105
- **全部参数说明(可通过 `jms -h` 查看):**
106
- | 参数 | 说明 | 默认值 |
107
- | --- | --- | --- |
108
- | `path` | 要共享的根目录(位置参数) | 当前目录 |
109
- | `-P, --password` | 登录密码,空表示免密 | 空 |
110
- | `-H, --host` | 监听地址 | `0.0.0.0` |
111
- | `-p, --port` | 监听端口 | `80` |
112
- | `-s, --ssl` | 启用 HTTPS(adhoc 自签名) | 关闭 |
113
- | `-o, --option` | [jmcomic](https://github.com/hect0x7/JMComic-Crawler-Python) 配置文件路径,开启在线下载 | 无 |
114
- | `--ip-whitelist` | IP 白名单,逗号分隔 | 不限制 |
115
- | `--current-path` | 初始当前路径 | 同 `path` |
116
- | `-e, --env` | 设置环境变量 `KEY=VALUE`,可重复 | 无 |
117
- | `--debug` | 开启 Flask debug 模式 | 关闭 |
118
-
119
- > 注:如果你在 Linux/macOS 上启动报错没有权限,是因为绑定默认的 80 端口需要管理员权限。建议加上 `-p 8080` 参数改用其他端口。
120
-
121
- ---
122
-
123
- ## 👨‍💻 开发者专属区域
124
-
125
- 如果你想在自己的 Python 脚本中集成或二次开发该服务,可以通过代码进行调用。
126
-
127
- ### 1. HTTP / HTTPS 原生调用
128
- ```python
129
- from plugin_jm_server import *
130
-
131
- # 启动 HTTP 服务
132
- server = JmServer('D:/', 'password')
133
- server.run(host='0.0.0.0', port=80)
134
-
135
- # 启动 HTTPS 服务 (需要安装 cryptography)
136
- server.run(host='0.0.0.0', port=443, ssl_context='adhoc')
137
- ```
138
-
139
- ### 2. 作为 jmcomic 的插件集成
140
- 你可以在 `jmcomic` 的 `op.yml` 配置文件中配置它:
141
- ```yml
142
- plugins:
143
- after_init:
144
- - plugin: jm_server
145
- kwargs:
146
- password: ''
147
- ```
148
- 对应的启动脚本注意事项:
149
- ```python
150
- from jmcomic import *
151
-
152
- op = create_option('op.yml')
153
- op.download_album(123)
154
-
155
- # 注意:虽然爬虫主线程执行完毕,但 Web 服务器线程仍在运行中。
156
- # 需要用户手动按 Ctrl+C 退出。
157
- # Python 3.12+ 特别注意:必须插入下面这行代码,Web 服务器才能继续处理请求!
158
- op.wait_all_plugins_finish()
159
- ```
160
-
161
- ---
162
-
163
- ## 💡 想法起源
164
-
165
- - 想法起源:https://github.com/hect0x7/JMComic-Crawler-Python/issues/192
166
- - UI 与部分基础架构参考:https://github.com/AiCorein/Flask-Files-Server
@@ -1,60 +0,0 @@
1
- from setuptools import setup, find_packages
2
-
3
- with open("README.md", encoding='utf-8') as f:
4
- long_description = f.read()
5
-
6
- version = None
7
- with open('./src/plugin_jm_server/__init__.py', encoding='utf-8') as f:
8
- for line in f:
9
- if '__version__' in line:
10
- version = line[line.index("'") + 1: line.rindex("'")]
11
- break
12
-
13
- if version is None:
14
- print('Set version first!')
15
- exit(1)
16
-
17
- setup(
18
- name='plugin_jm_server',
19
- version=version,
20
- description='plugin_jm_server, a plugin for jmcomic that can be used to view comics in a web browser.',
21
- long_description_content_type="text/markdown",
22
- long_description=long_description,
23
- url='https://github.com/hect0x7/plugin-jm-server',
24
- author='hect0x7',
25
- author_email='93357912+hect0x7@users.noreply.github.com',
26
- packages=find_packages("src"),
27
- package_dir={"": "src"},
28
- python_requires=">=3.7",
29
- install_requires=[
30
- 'jmcomic',
31
- 'flask',
32
- 'psutil',
33
- 'cryptography',
34
- ],
35
- keywords=['python', 'jmcomic', '18comic', '禁漫天堂', 'NSFW'],
36
- classifiers=[
37
- "Development Status :: 4 - Beta",
38
- "Intended Audience :: Developers",
39
- "Programming Language :: Python :: 3.7",
40
- "Programming Language :: Python :: 3.8",
41
- "Programming Language :: Python :: 3.9",
42
- "Programming Language :: Python :: 3.10",
43
- "Programming Language :: Python :: 3.11",
44
- "Programming Language :: Python :: 3.12",
45
- "Operating System :: MacOS",
46
- "Operating System :: POSIX :: Linux",
47
- "Operating System :: Microsoft :: Windows",
48
- ],
49
- entry_points={
50
- 'console_scripts': [
51
- 'jms = plugin_jm_server.cli:main',
52
- ],
53
- },
54
- package_data={
55
- "plugin_jm_server": [
56
- "static/**",
57
- "templates/**",
58
- ],
59
- }
60
- )
@@ -1,3 +0,0 @@
1
- __version__ = '0.2.3'
2
-
3
- from .app import *
@@ -1,5 +0,0 @@
1
- """支持 `python -m plugin_jm_server ...` 方式启动。"""
2
- from .cli import main
3
-
4
- if __name__ == '__main__':
5
- main()