Skip to content

Commit

Permalink
Merge pull request #66 from Zeal-L/develop
Browse files Browse the repository at this point in the history
Documentation
  • Loading branch information
Zeal-L authored Aug 15, 2023
2 parents 0e2b6ad + f36a274 commit d1c75d5
Show file tree
Hide file tree
Showing 15 changed files with 179 additions and 162 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Report.*
~$rEPORT.DOCX

codiga.yml
哔哩哔哩漫画下载器.exe
哔哩哔哩漫画下载器*


# Byte-compiled / optimized / DLL files
Expand Down
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
**因此 将将将~ 🎉 一个好用的哔哩哔哩漫画下载器就此诞生!**

## :sparkles: 主要功能 / 特性
- **~~(白嫖)~~ 黑科技下载未解锁章节!**
- **已打包成单个可执行文件,双击即用!**
- **易操作的图形界面!~~(不用再费劲的部署环境跑命令行)~~**
- **无需漫画ID,可直接关键词搜索漫画!并附带搜索词高亮!**
- **支持B站和BiliPlus两种解析方式!**
- **可配置的多线程下载,速度拉满!**
- **实现了应对网络波动等情况的异常重试,以及应用了指数级退让来避免在短时间大量重试被拉黑名单**
- **丰富的漫画详情信息,本地漫画管理功能,一键检查更新!**
Expand All @@ -40,17 +40,17 @@
## 📸 相关截图
**使用哔站解析**
<div align=center>
<img src="https://github.com/Zeal-L/BiliBili-Manga-Downloader/assets/72005386/39f4e66f-50f1-410b-8761-971eeb9cf30e" width=80%>
<img src="https://github.com/Zeal-L/BiliBili-Manga-Downloader/assets/72005386/39f4e66f-50f1-410b-8761-971eeb9cf30e" width=90%>
</div>

**使用BiliPlus解析**
<div align=center>
<img src="https://github.com/Zeal-L/BiliBili-Manga-Downloader/assets/72005386/4686f08b-2e88-4070-8d90-661c0a4392b6" width=80%>
<img src="https://github.com/Zeal-L/BiliBili-Manga-Downloader/assets/72005386/4686f08b-2e88-4070-8d90-661c0a4392b6" width=90%>
</div>

**下载进度界面**
<div align=center>
<img src="https://github.com/Zeal-L/BiliBili-Manga-Downloader/assets/72005386/9c99e3c8-4283-4b0d-a5cd-23dab08b78b6" width=80%>
<img src="https://github.com/Zeal-L/BiliBili-Manga-Downloader/assets/72005386/9c99e3c8-4283-4b0d-a5cd-23dab08b78b6" width=90%>
</div>

## 📝 使用指南
Expand All @@ -68,8 +68,8 @@
6. 如果提示 `Cookie有效!` 那么就成功了!
7. 否则请再次确认上述步骤,检查是否正确复制内容不含空格,还有疑问的话欢迎联系作者或提 `Issues`
- **BiliPlus解析**
- 利用 [biliplus](https://www.biliplus.com/) 提供的 [ComicWebReader](https://www.biliplus.com/manga/) 在线漫画平台的api来尝试获取未解锁的漫画章节
- 该网站现有 4w+ 已关联 `Bilibili` 帐号的访客,也就是说很有概率你想看的漫画已经有人购买了,所以你可以白嫖
- 利用 [biliplus](https://www.biliplus.com/) 提供的 [ComicWebReader](https://www.biliplus.com/manga/) 在线漫画平台的api来尝试获取更多的可下载章节
- 该网站现有 4w+ 已关联 `Bilibili` 帐号的访客,也就是说很有概率你想看的漫画已经有人购买了,所以可以尝试一下
- **特别提示: 毕竟是要提供 Cookie 给第三方网站托管,因此可能会有潜在的安全风险。敏感人群请不要使用自己主账号的 Cookie**
- `BiliPlus``Cookie` 获取方法跟上述一致,在 [ComicWebReader](https://www.biliplus.com/manga/) 登入后在开发者工具中找到 `access_key` 粘贴到程序设置选项中的 `BiliPlus Cookie` 即可

Expand Down Expand Up @@ -102,11 +102,10 @@
-~~添加不同的界面主题~~
-~~添加检测cookie无效或者过期功能,并且弹窗~~
-~~鼠标移动到漫画封面改变鼠标图标,提示用户可以点击跳转~~
-~~给章节详情添加一个提示,告诉用户可以右键多选~~
-~~一键检查软件更新功能~~
-~~除pdf以外添加不同的保存选项如 7z 或者 基本的文件夹图片~~
-~~启动程序时多线程加载本地库存,避免用户等待太久~~
-~~给打包好的程序添加版本号版权等属性信息~~
-~~因为网络错误跳过任务后,更新总进度条的进度,速度和剩余时间信息~~

## 🏗️ 本地构建 / 编译
- **首先确保你安装了 Python >= 3.11 和 git**
Expand Down Expand Up @@ -144,7 +143,8 @@
- 新增功能:
- 二维码登入
- 利用 [biliplus](https://www.biliplus.com/) 提供的 [ComicWebReader](https://www.biliplus.com/manga/) 在线漫画平台的api来尝试获取未解锁的漫画章节
- 优化配置: 移除保存文件夹名里的漫画ID信息;元数据现在默认保存,并且以此来初始化我的库存
- 优化配置:
- 移除保存文件夹名里的漫画ID信息;元数据现在默认保存,并且以此来初始化我的库存
- 老用户需要重新下载一章漫画,然后把以前下载好的移动到新文件夹中
- 修复bug:
- 修复个别`png`保存为`jpg`的情况
Expand Down Expand Up @@ -197,10 +197,16 @@
<img src="https://user-images.githubusercontent.com/72005386/223096480-8d57ceef-0b33-4653-86bf-55e6094fcb9b.jpg" width=20%> <img src="https://user-images.githubusercontent.com/72005386/223096520-e5d95ac8-044d-4644-8500-3770e5ad81f8.jpg" width=18.5%>

## 🔒️ 许可协议
- 本项目使用 [**GNU Affero General Public License v3.0**](https://www.gnu.org/licenses/agpl-3.0.en.html) 发布
- 如对代码有所修改,请按照许可协议要求发布
- 本程序仅供学习交流使用,严禁用于商业用途

- 本项目在遵循 [**GNU Affero General Public License v3.0**](https://www.gnu.org/licenses/agpl-3.0.en.html) 许可协议下进行发布
- 若对代码进行了修改,请务必遵循许可协议的规定进行发布
- **特别提醒,未经合法授权,擅自使用本项目的内容可能涉及侵权行为,我们保留追究相应法律责任的权利**

## ⚠️ 免责申明
- **本软件提供的所有内容,仅可用作学习交流使用,未经版权方以及原作者授权,禁止用于商业目的以及其他用途。请在下载24小时内删除。为尊重版权,请前往资源的原始发布网站观看,支持原创,谢谢**
- 本软件只提供漫画解析,不提供任何个人信息上传、存储到服务器的功能
- 本软件解析得到的所有内容均来自哔哩哔哩漫画官方上传、分享,其版权均归原作者以及哔哩哔哩漫画所有。内容提供者、上传者应对其提供、上传的内容承担全部责任
- 因使用本软件产生的版权问题,软件作者概不负责
- 我们强烈建议您详细阅读并遵守许可协议的规定,以保障您与他人的权益和合法使用
## 🌟 Star History

[![Star History Chart](https://api.star-history.com/svg?repos=Zeal-L/BiliBili-Manga-Downloader&type=Date)](https://star-history.com/#Zeal-L/BiliBili-Manga-Downloader)
Expand Down
10 changes: 4 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import os
import sys
from sys import argv, exit
from ctypes import windll

sys.path.append(os.path.join(os.path.dirname(__file__), "src", "ui"))

from PySide6.QtWidgets import QApplication, QMessageBox

from src.ui.MainGUI import MainGUI
from src.utils import __version__
from src.Utils import __version__


if __name__ == "__main__":
app = QApplication.instance() or QApplication(sys.argv)
app = QApplication.instance() or QApplication(argv)

if windll.user32.FindWindowW(None, f"哔哩哔哩漫画下载器 v{__version__}") != 0:
box = QMessageBox.information(None, "提示", "有一个我已经不满足不了你吗?\n\t...(。•ˇ‸ˇ•。) ...")
sys.exit(0)
exit(0)

window = MainGUI(app)
window.show()
Expand Down
20 changes: 10 additions & 10 deletions src/BiliPlus.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
from __future__ import annotations

import typing
from typing import TYPE_CHECKING

import requests
from retrying import retry
from bs4 import BeautifulSoup
from retrying import retry

from src.Comic import Comic
from src.Episode import Episode
from src.utils import logger, MAX_RETRY_SMALL, RETRY_WAIT_EX, TIMEOUT_SMALL
from src.Utils import MAX_RETRY_SMALL, RETRY_WAIT_EX, TIMEOUT_SMALL, logger

if typing.TYPE_CHECKING:
if TYPE_CHECKING:
from ui.MainGUI import MainGUI


Expand Down Expand Up @@ -81,7 +81,7 @@ def _(url: str = biliplus_detail_url) -> dict:
logger.warning(f"漫画id:{self.comic_id} 在BiliPlus获取漫画信息失败! 重试中...\n{e}")
raise e
if "未登录" in res.text:
mainGUI.message_box.emit("请先在设置界面填写正确的BiliPlus Cookie!")
mainGUI.signal_message_box.emit("请先在设置界面填写正确的BiliPlus Cookie!")
return
if res.status_code != 200:
logger.warning(
Expand Down Expand Up @@ -110,7 +110,7 @@ def _(url: str = biliplus_detail_url) -> dict:
total_ep = total_ep_element.contents[0].split("/")[1]
total_pages = int(int(total_ep) / 200) + 1
for pages in range(2, total_pages + 1):
mainGUI.resolve_status.emit(f"正在解析漫画章节({pages}/{total_pages})...")
mainGUI.signal_resolve_status.emit(f"正在解析漫画章节({pages}/{total_pages})...")
page_html = _(f"{biliplus_detail_url}&page={pages}")
document = BeautifulSoup(page_html, "html.parser")
ep_items = document.find_all("div", {"class": "episode-item"})
Expand All @@ -123,7 +123,7 @@ def _(url: str = biliplus_detail_url) -> dict:
except Exception as e:
logger.error(f"漫画id:{self.comic_id} 在处理BiliPlus解锁章节数据时失败!\n{e}")
logger.exception(e)
mainGUI.message_box.emit(
mainGUI.signal_message_box.emit(
f"漫画id:{self.comic_id} 在处理BiliPlus解锁章节数据时失败!\n\n更多详细信息请查看日志文件, 或联系开发者!"
)

Expand Down Expand Up @@ -186,7 +186,7 @@ def _() -> list[dict]:
f"《{self.comic_name}》章节:{self.title} 从BiliPlus重复获取图片列表多次后失败!,跳过!\n{e}"
)
logger.exception(e)
mainGUI.message_box.emit(
mainGUI.signal_message_box.emit(
f"《{self.comic_name}》章节:{self.title} 从BiliPlus重复获取图片列表多次后失败!\n已暂时跳过此章节!\n请检查网络连接或者重启软件!\n\n更多详细信息请查看日志文件, 或联系开发者!"
)
return False
Expand All @@ -206,7 +206,7 @@ def _() -> list[dict]:
logger.error(
f"《{self.comic_name}》章节:{self.title} 在处理BiliPlus地址时因Cookie有误导致失败!"
)
mainGUI.message_box.emit(
mainGUI.signal_message_box.emit(
f"《{self.comic_name}》章节:{self.title} 在处理BiliPlus解锁章节图片地址时因Cookie有误导致失败!"
)
return False
Expand All @@ -215,7 +215,7 @@ def _() -> list[dict]:
f"《{self.comic_name}》章节:{self.title} 在处理BiliPlus解锁章节图片地址时失败!\n{e}"
)
logger.exception(e)
mainGUI.message_box.emit(
mainGUI.signal_message_box.emit(
f"《{self.comic_name}》章节:{self.title} 在处理BiliPlus解锁章节图片地址时失败!\n\n更多详细信息请查看日志文件, 或联系开发者!"
)
return False
Expand Down
14 changes: 8 additions & 6 deletions src/BiliQrCode.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
from __future__ import annotations

import io
import time
from typing import TYPE_CHECKING

import typing

import requests
import qrcode
from retrying import retry
import requests
from PySide6.QtCore import SignalInstance
from PySide6.QtWidgets import QMessageBox
from retrying import retry

from src.utils import logger, MAX_RETRY_SMALL, RETRY_WAIT_EX, TIMEOUT_SMALL
from src.Utils import MAX_RETRY_SMALL, RETRY_WAIT_EX, TIMEOUT_SMALL, logger

if typing.TYPE_CHECKING:
if TYPE_CHECKING:
from ui.MainGUI import MainGUI


Expand Down Expand Up @@ -51,6 +51,8 @@ def _() -> dict:
raise requests.HTTPError()
return res.json()["data"]

logger.info("正在获取登入二维码...")

try:
data = _()
self.code_url = data["url"]
Expand Down
12 changes: 6 additions & 6 deletions src/Comic.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
from __future__ import annotations

import typing
import re
from typing import TYPE_CHECKING

import requests
from retrying import RetryError, retry
import re

from src.Episode import Episode
from src.utils import (
logger,
from src.Utils import (
MAX_RETRY_SMALL,
RETRY_WAIT_EX,
TIMEOUT_SMALL,
isCheckSumValid,
logger,
)

if typing.TYPE_CHECKING:
if TYPE_CHECKING:
from ui.MainGUI import MainGUI


Expand Down Expand Up @@ -128,7 +128,7 @@ def _() -> bytes:
return img
except RetryError as e:
logger.error(f"获取封面图片多次后失败,跳过!\n{e}")
self.mainGUI.message_box.emit(
self.mainGUI.signal_message_box.emit(
f"获取封面图片多次后失败!\n请检查网络连接或者重启软件!\n\n更多详细信息请查看日志文件, 或联系开发者!"
)
return open(":/imgs/fail_img.jpg")
Expand Down
Loading

0 comments on commit d1c75d5

Please sign in to comment.