plugin_jm_server, a plugin for jmcomic that can be used to view comics in a web browser.
Project description
plugin-jm-server
“离线版”禁漫天堂
该项目会在本地起一个文件服务器,支持用浏览器查看文件夹内的图片,界面模仿禁漫的章节观看页面,并适配手机端。
用浏览器的好处就是支持很多浏览器插件和脚本,例如:
效果图(文件浏览、整章看图)
1. 电脑浏览器访问
登录页
文件夹列表页
看本模式
文件夹&看本 二合一模式
2. 手机浏览器访问
登录页
文件夹列表页
看本模式
局域网消息(方便手机和电脑互传消息)
使用方式
1. pip安装
pip install plugin_jm_server
2. 运行代码
- HTTP版
from plugin_jm_server import *
# http
server = JmServer(
'D:/',
'password',
)
server.run(
host='0.0.0.0',
port=80,
)
- HTTPS版
from plugin_jm_server import *
# https
server = JmServer(
'D:/',
'password',
)
server.run(
host='0.0.0.0',
port=443,
ssl_context='adhoc',
)
- 作为jmcomic的插件
# 配置文件
plugins:
after_init:
# after_album:
- plugin: jm_server
kwargs:
password: ''
# 代码
from jmcomic import *
op = create_option('op.yml')
op.download_album(123)
# 运行到这里,虽然主线程代码执行完毕,但程序不会退出,因为服务器线程还没有结束。
# 控制台会输出提示信息如下(atexit时输出的):
# “主线程执行完毕,但插件jm_server的服务器线程仍运行中,可按下ctrl+c结束程序”
# 此时需要你主动按下ctrl+c终止程序。
# python 3.12 特别注意:需要插入下面这行代码,服务器才能继续处理请求
op.wait_all_plugins_finish()
前端页面与功能介绍
本项目提供了一套完整的 Web 前端界面,用于管理和浏览本地图片资源。主要包含以下三个核心页面及其功能:
1. 登录页
为了保护个人隐私,系统提供了简单的访问控制。
- 密码验证:启动时可配置密码,访问时需校验通过。
- 设备自适应:根据访问设备(手机/电脑)自动适配最佳的登录布局。
2. 文件夹浏览页(主页)
这是资源管理的核心入口,支持高效的文件查找与导航。目前最新版本采用了 SPA(单页应用)架构进行全面增强:
- 智能路径导航:
- 路径补全:输入路径时自动联想下级文件夹,支持键盘上下键选择及回车跳转。
- 层级跳转:输入框支持“..”快速返回上一级,并提供“确认”按钮进行精准跳转。
- 可视化展示:
- 文件夹预览:鼠标悬停在文件夹上时,会自动展示该文件夹内的首张图片作为封面预览。
- 类型区分:通过文件夹角标(图标)清晰区分普通文件夹与特殊资源文件夹。
- 辅助功能:
- 书签管理:支持将常看目录加入左侧书签栏,方便下次快速访问。
- 本地交互:支持通过网页菜单直接打开服务器端对应的本地文件夹窗口(Explorer)。
3. 图片阅读页(看本模式)
专为漫画阅读优化的沉浸式浏览页面。
- 加载优化:采用图片懒加载机制,流畅浏览含有数百张图片的大型章节,节省系统资源。
- 多端适配:
- PC端:适合大屏浏览,支持浮动工具栏进行页面跳转、全屏切换等。
- 移动端:适配触摸操作,提供更好的手机阅读体验。
- 阅读辅助:
- 浮动菜单:提供“回到顶部”、“加载全部图片”及“在资源管理器打开”等便捷操作。
- 键盘支持:支持常用快捷键进行页面滚动和翻页。
4. 局域网消息中心 (v0.2.2+ New)
本项目最新版本引入了即时通讯与增强的局域网接入支持。
- 实时互动:支持服务器与内网设备之间互发即时消息,采用暗色毛玻璃视觉风格。
- 全站通知:后台实时轮询新消息,支持浏览器原生桌面通知及精美的网页侧边栏滑入提醒。
- 接入优化:自动识别服务器在局域网内的真实物理 IP,主页提供一键复制功能。
- 非侵入式反馈:全站移除 alert 阻塞弹窗,所有交互操作结果均通过通知条反馈。
想法起源
想法起源:https://github.com/hect0x7/JMComic-Crawler-Python/issues/192
基于原项目:https://github.com/AiCorein/Flask-Files-Server
为了方便修改,将原项目中的文件复制到本项目中,然后进行修改
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plugin_jm_server-0.2.2.tar.gz.
File metadata
- Download URL: plugin_jm_server-0.2.2.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8527f1a6171385ae55e38281f029182ea2c155c0bec7cf207ca8e674e0684e76
|
|
| MD5 |
f707f8b2ccd6a4c37c776d1200509938
|
|
| BLAKE2b-256 |
9901a2f55ce04869947ceac85caa74ee646ef7e3317d7f1e7c5c4dc5e42d4400
|
Provenance
The following attestation bundles were made for plugin_jm_server-0.2.2.tar.gz:
Publisher:
release_auto.yml on hect0x7/plugin-jm-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plugin_jm_server-0.2.2.tar.gz -
Subject digest:
8527f1a6171385ae55e38281f029182ea2c155c0bec7cf207ca8e674e0684e76 - Sigstore transparency entry: 1340346323
- Sigstore integration time:
-
Permalink:
hect0x7/plugin-jm-server@06c4990b3102be8912e74e234a629bc5c370e399 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/hect0x7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_auto.yml@06c4990b3102be8912e74e234a629bc5c370e399 -
Trigger Event:
push
-
Statement type:
File details
Details for the file plugin_jm_server-0.2.2-py3-none-any.whl.
File metadata
- Download URL: plugin_jm_server-0.2.2-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba87569c93777afd9d08d9c3fc10b4952958d103be5acc8395485f2ee0ed1023
|
|
| MD5 |
dbad812efbc9e9f9f914b6cb6a0f67f4
|
|
| BLAKE2b-256 |
fd14e97be29c56294ba2bfe0f6bd92d893181ee0c022bf20d046c13712b7636e
|
Provenance
The following attestation bundles were made for plugin_jm_server-0.2.2-py3-none-any.whl:
Publisher:
release_auto.yml on hect0x7/plugin-jm-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plugin_jm_server-0.2.2-py3-none-any.whl -
Subject digest:
ba87569c93777afd9d08d9c3fc10b4952958d103be5acc8395485f2ee0ed1023 - Sigstore transparency entry: 1340346339
- Sigstore integration time:
-
Permalink:
hect0x7/plugin-jm-server@06c4990b3102be8912e74e234a629bc5c370e399 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/hect0x7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_auto.yml@06c4990b3102be8912e74e234a629bc5c370e399 -
Trigger Event:
push
-
Statement type: