Skip to content

Commit

Permalink
fix: qt env;
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoneri committed Oct 30, 2024
1 parent 2439f04 commit 1136bb6
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 23 deletions.
1 change: 1 addition & 0 deletions GUI/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def chooseBox_changed_tips(self, index):
self.say(TextUtils.warning_(f'<br>{"*" * 10} {self.res.toolBox_warning}<br>'))
if index == 1:
self.pageEdit.setStatusTip(self.pageEdit.statusTip() + f" {self.res.copymaga_page_status_tip}")
self.say(font_color('<br>' + self.res.copymaga_tips, color='purple'))
elif index == 2:
self.say(font_color(self.res.jm_bookid_support, color='blue'))
elif index == 3 and not conf.proxies:
Expand Down
2 changes: 1 addition & 1 deletion GUI/uic/conf_dia.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def retranslateUi(self, Dialog):
self.label_4.setToolTip(_translate("Dialog", "proxies"))
self.label_4.setText(_translate("Dialog", "代理"))
self.proxiesEdit.setToolTip(_translate("Dialog", "proxies"))
self.proxiesEdit.setPlaceholderText(_translate("Dialog", "example x.x.x.x:y"))
self.proxiesEdit.setPlaceholderText(_translate("Dialog", "example-of-v2rayN 127.0.0.1:10809"))
self.label_3.setToolTip(_translate("Dialog", "custom_map"))
self.label_3.setText(_translate("Dialog", "映射"))
self.label_completer.setToolTip(_translate("Dialog", "completer/preset"))
Expand Down
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,17 @@
## 📢更新

### V1.6 | 2024-10-26
### V1.6 | 2024-10-30

修复win的某些qt环境导致主程序无法打开等问题

`ehentai` 改版更新
> 下一个绿色包版本`todo list`
> - [ ] 1\. 解决拷贝章节api limit=300
> - [ ] 2\. ero本网读取剪切板功能做到工具箱中,构思:读50条匹配当前序号网站,出预览窗口显示匹配规则、减选确认
### V1.6 | 2024-10-15
### V1.6 | 2024-10-26

拷贝在配置设了代理后能解锁章节了,例如`黑暗集会`(之前没在意就忽略了)
`ehentai` 改版修复

> [点击查看更新历史](https://github.com/jasoneri/ComicGUISpider/wiki/%E6%9B%B4%E6%96%B0%E8%AE%B0%E5%BD%95-update-record)
Expand Down Expand Up @@ -88,7 +92,7 @@
|:-----------|:------------:|:---------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 存储路径 | sv_path | D:\comic | 下载目录(内容目录结构里还有个`web`文件夹的情况是因为默认关联[`comic_viewer`项目](https://github.com/jasoneri/comic_viewer)所以这样设置的) |
| 日志等级 | log_level | `WARNING` | 后台运行过后会有log目录,GUI 与 后台 同级,报错时GUI会进行操作指引 |
| 代理 | proxies | | 翻墙用,`jm`用的内地域名此项对其无效<br/>(建议使用代理模式在此配置代理,而非全局代理模式,不然访问图源会吃走大量代理的流量) |
| 代理 | proxies | | 翻墙用,`jm`用的内地域名此项对其无效(全局代理反而会令`jm`无法使用)<br/>(建议使用代理模式在此配置代理,而非全局代理模式,不然访问图源会吃走大量代理的流量) |
| 映射 | custom_map | | 搜索输入映射 当搜索与预设不满足使用时,先在此加入键值对,重开gui在搜索框输入自定义键就会将对应网址结果输出<br/>1. 映射无需理会域名,前提是用在当前网站,只要满足 `不用映射时能访问``填入的不是无效的url`,<br/>程序会内置替换成可用的域名,如非代理下映射的`wnacg.com`会自动被替换掉<br/>2. 已无需使用映射做翻页,但注意的是自制映射有可能超出翻页规则范围,此时可通知开发者进行扩展 |
| 预设 | completer | | 搜索框按<kbd>空格</kbd>弹出的内容,鼠标悬停在输入框会有`序号对应网站`的提示(其实就是选择框的序号),视频3有介绍用法 |
| eh_cookies | eh_cookies | | 使用`ehentai`时必需,[点击查看获取方法](https://raw.githubusercontent.com/jasoneri/imgur/main/CGS/ehentai_get_cookies.gif) ([ 国内备链 ](https://jsd.onmicrosoft.cn/gh/jasoneri/imgur@main/CGS/ehentai_get_cookies.gif)) |
Expand Down Expand Up @@ -117,7 +121,11 @@ JavaScript 没加载出来,刷新一下页面
看下方交流群,但提问格式请参考 [issue的样式](https://raw.githubusercontent.com/jasoneri/imgur/main/CGS/issue-format.png)
,一句连标点符号都不带没有上下文的话并不是一个好问题/反馈

### 4. macOS相关
### 4. 解压后主程序无法打开/报错含`Qt`字眼等

直接进群反馈,具体问题具体分析

### 5. macOS相关

#### 1. 数字输入似乎有问题

Expand Down
Binary file modified assets/conf_usage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions assets/res/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class GUI:
u'<font color="black"> 或者 </font>'
u'<a href="%s" ><b style="font-size:20px;">浏览器查看结果</b></a>')
WorkThread_finish_flag = "完成任务" # related to SPIDER.close_success
copymaga_tips = "拷贝漫画在配置代理后能解锁章节,例如芙莉莲、黑暗集会等(此提示后再配置代理则需要重启/retry程序)"
copymaga_page_status_tip = "拷贝漫画的翻页数使用的offset/序号,一页30条,想翻到第3页就填60(输出60-89),类推"
global_err_hook = "刚才操作导致 GUI 发生异常, 详细查阅 GUI 日志"

Expand Down Expand Up @@ -91,6 +92,7 @@ class Updater:
not_pkg_markdown = "当前环境无法使用此功能,需要重新下载绿色安装包"
token_invalid_notification = ("[ 本地文件的token全部失效,当前将使用无状态去请求github api(受限60请求/小时)]\n"
"下次使用更新会重新下载token文件,还是全部失效的话可截图告知开发者")
token_unknow_error = "使用token时出现未知错误,当前将使用无状态去请求github api(受限60请求/小时)"
latest_code_overwriting = "使用最新版本代码覆盖中"
too_much_waiting_update = "检测到堆积过多待更新版本,将忽略更新消息直接拉至最新版本代码"
refreshing_code = "更新代码中"
Expand Down
2 changes: 2 additions & 0 deletions assets/zh_cn.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class GUI:
u'<font color="black"> 或者 </font>'
u'<a href="%s" ><b style="font-size:20px;">浏览器查看结果</b></a>')
WorkThread_finish_flag = "完成任务" # related to SPIDER.close_success
copymaga_tips = "拷贝漫画在配置代理后能解锁章节,例如芙莉莲、黑暗集会等(此提示后再配置代理则需要重启/retry程序)"
copymaga_page_status_tip = "拷贝漫画的翻页数使用的offset/序号,一页30条,想翻到第3页就填60(输出60-89),类推"
global_err_hook = "刚才操作导致 GUI 发生异常, 详细查阅 GUI 日志"

Expand Down Expand Up @@ -91,6 +92,7 @@ class Updater:
not_pkg_markdown = "当前环境无法使用此功能,需要重新下载绿色安装包"
token_invalid_notification = ("[ 本地文件的token全部失效,当前将使用无状态去请求github api(受限60请求/小时)]\n"
"下次使用更新会重新下载token文件,还是全部失效的话可截图告知开发者")
token_unknow_error = "使用token时出现未知错误,当前将使用无状态去请求github api(受限60请求/小时)"
latest_code_overwriting = "使用最新版本代码覆盖中"
too_much_waiting_update = "检测到堆积过多待更新版本,将忽略更新消息直接拉至最新版本代码"
refreshing_code = "更新代码中"
Expand Down
2 changes: 2 additions & 0 deletions deploy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class Env:

def __init__(self, _p: pathlib.Path):
self.proj_p = _p
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = str(
proj_path.parent.joinpath(r"site-packages\PyQt5\Qt5\plugins\platforms"))

def env_init(self):
...
Expand Down
3 changes: 2 additions & 1 deletion deploy/packer.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ def env_supplement():
if __name__ == '__main__':
# clean()
Clean.end_work(path.joinpath("scripts").rglob("__pycache__"), path.joinpath("site-packages").rglob("__pycache__"),
(path.joinpath("scripts/log"), path.joinpath("scripts/version"))) # step 0 必清site-packages cache,太大了
(path.joinpath("scripts/log"), path.joinpath("scripts/version"),
path.joinpath("scripts/deploy/gitee_t.json"))) # step 0 必清site-packages cache,太大了
# Packer.bat_to_exe() # step 1
packer = Packer(('scripts', f'{proj}.bat'))
packer.packup(runtime_init=True) # step 2
Expand Down
2 changes: 0 additions & 2 deletions deploy/t.json

This file was deleted.

30 changes: 17 additions & 13 deletions deploy/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,23 @@ def headers(self):
return {**headers, 'Authorization': self.token} if self.token else headers

def check_token(self):
if not self.gitee_t_file.exists():
self.download_t_file()
with open(self.gitee_t_file, 'r', encoding='utf-8') as f:
tokens = json.load(f)
for _token in tokens:
token = f"Bearer {base64.b64decode(_token).decode()}"
with httpx.Client(headers={**headers, 'Authorization': token}) as client:
resp = client.head(f"https://api.github.com")
if str(resp.status_code).startswith('2'):
return token
else:
print(Fore.RED + res.token_invalid_notification)
os.remove(self.gitee_t_file)
try:
if not self.gitee_t_file.exists():
self.download_t_file()
with open(self.gitee_t_file, 'r', encoding='utf-8') as f:
tokens = json.load(f)
for _token in tokens:
token = f"Bearer {base64.b64decode(_token).decode()}"
with httpx.Client(headers={**headers, 'Authorization': token}) as client:
resp = client.head(f"https://api.github.com")
if str(resp.status_code).startswith('2'):
return token
else:
print(Fore.RED + res.token_invalid_notification)
os.remove(self.gitee_t_file)
except Exception:
print(Fore.RED + res.token_unknow_error)
return

def download_t_file(self):
with open(self.gitee_t_file, 'w', encoding='utf-8') as f:
Expand Down

0 comments on commit 1136bb6

Please sign in to comment.