mirror of
https://github.com/NaiboWang/EasySpider.git
synced 2025-04-20 10:05:00 +08:00
自动压缩的脚本
This commit is contained in:
parent
199af8ac40
commit
71c751a8cd
@ -2,7 +2,7 @@ To open the EasySpider, please open your terminal, and then type:
|
||||
./easy-spider.sh
|
||||
Then EasySpider will be opened, and don't close the terminal when running EasySpider.
|
||||
|
||||
Official Site: https://github.com/NaiboWang/EasySpider
|
||||
Official Site: https://www.easyspider.net
|
||||
|
||||
Welcome to promote this software to other friends.
|
||||
|
||||
@ -13,9 +13,10 @@ Video Tutorial: https://youtube.com/playlist?list=PL0kEFEkWrT7mt9MUlEBV2DTo1Qsaa
|
||||
Tasks can be imported from other machines by simply placing the .json files from the "tasks" folder of those machines into the "tasks" folder of this directory. Similarly, execution instance files can be imported by copying the .json files from the "execution_instances" folder. Note that only files named with a number greater than 0 are supported in both folders.
|
||||
|
||||
|
||||
|
||||
======Version Update Instruction======
|
||||
|
||||
Please see more new features for version greater than v0.3.2 at github release page: https://github.com/NaiboWang/EasySpider/releases
|
||||
|
||||
-----v0.3.2-----
|
||||
|
||||
## Update Instruction
|
||||
|
@ -4,7 +4,7 @@
|
||||
./easy-spider.sh
|
||||
注意软件运行过程中不要关闭terminal。
|
||||
|
||||
官方网址: https://github.com/NaiboWang/EasySpider
|
||||
官方网址: https://www.easyspider.cn
|
||||
|
||||
支持Ubuntu 20.04, Debian, Deepin x64及以上版本。
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
|
||||
======版本更新说明======
|
||||
|
||||
v0.3.2以上版本更新说明请查看Github Release Pages页面:https://github.com/NaiboWang/EasySpider/releases
|
||||
|
||||
-----v0.3.2-----
|
||||
|
||||
## 更新说明
|
||||
|
@ -1,4 +1,4 @@
|
||||
Official Site: https://github.com/NaiboWang/EasySpider
|
||||
Official Site: https://www.easyspider.net
|
||||
|
||||
Welcome to promote this software to other friends.
|
||||
|
||||
@ -12,6 +12,8 @@ You can import tasks from other machines by simply opening the EasySpider softwa
|
||||
|
||||
======Version Update Instruction======
|
||||
|
||||
Please see more new features for version greater than v0.3.2 at github release page: https://github.com/NaiboWang/EasySpider/releases
|
||||
|
||||
-----v0.3.2-----
|
||||
|
||||
## Update Instruction
|
||||
|
@ -1,6 +1,6 @@
|
||||
欢迎将软件宣传给更多需要的朋友!
|
||||
|
||||
官方网址: https://github.com/NaiboWang/EasySpider
|
||||
官方网址: https://www.easyspider.cn
|
||||
|
||||
支持MacOS系统,包括Intel芯片和Arm芯片,如酷睿i7和M1芯片,最低MacOS系统版本为11.x。
|
||||
|
||||
@ -13,6 +13,8 @@
|
||||
|
||||
======版本更新说明======
|
||||
|
||||
v0.3.2以上版本更新说明请查看Github Release Pages页面:https://github.com/NaiboWang/EasySpider/releases
|
||||
|
||||
-----v0.3.2-----
|
||||
|
||||
## 更新说明
|
||||
|
@ -1,4 +1,4 @@
|
||||
Official Site: https://github.com/NaiboWang/EasySpider
|
||||
Official Site: https://www.easyspider.net
|
||||
|
||||
Welcome to promote this software to other friends.
|
||||
|
||||
@ -15,6 +15,8 @@ Tasks can be imported from other machines by simply placing the .json files from
|
||||
|
||||
======Version Update Instructions======
|
||||
|
||||
Please see more new features for version greater than v0.3.2 at github release page: https://github.com/NaiboWang/EasySpider/releases
|
||||
|
||||
-----v0.3.2-----
|
||||
|
||||
## Update Instruction
|
||||
|
1
.temp_to_pub/EasySpider_windows_x64/tasks/48.json
Normal file
1
.temp_to_pub/EasySpider_windows_x64/tasks/48.json
Normal file
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
欢迎将软件宣传给更多需要的朋友!
|
||||
|
||||
官方网址: https://github.com/NaiboWang/EasySpider
|
||||
官方网址: https://www.easyspider.cn
|
||||
|
||||
支持Windows 10 x64及以上版本。
|
||||
|
||||
@ -15,6 +15,8 @@ Windows 7此版本无直接可用版本(因为Chrome 109是最后一个支持W
|
||||
|
||||
======版本更新说明======
|
||||
|
||||
v0.3.2以上版本更新说明请查看Github Release Pages页面:https://github.com/NaiboWang/EasySpider/releases
|
||||
|
||||
-----v0.3.2-----
|
||||
|
||||
## 更新说明
|
||||
|
@ -1,4 +1,4 @@
|
||||
Official Site: https://github.com/NaiboWang/EasySpider
|
||||
Official Site: https://www.easyspider.net
|
||||
|
||||
Welcome to promote this software to other friends.
|
||||
|
||||
@ -15,6 +15,8 @@ Tasks can be imported from other machines by simply placing the .json files from
|
||||
|
||||
======Version New Features======
|
||||
|
||||
Please see more new features for version greater than v0.3.2 at github release page: https://github.com/NaiboWang/EasySpider/releases
|
||||
|
||||
-----v0.3.2-----
|
||||
|
||||
## Update Instruction
|
||||
|
@ -1,6 +1,6 @@
|
||||
欢迎将软件宣传给更多需要的朋友!
|
||||
|
||||
官方网址: https://github.com/NaiboWang/EasySpider
|
||||
官方网址: https://www.easyspider.cn
|
||||
|
||||
支持Windows 10 x32及以上版本。
|
||||
|
||||
@ -15,6 +15,8 @@ Windows 7此版本无直接可用版本(因为Chrome 109是最后一个支持W
|
||||
|
||||
======版本更新说明======
|
||||
|
||||
v0.3.2以上版本更新说明请查看Github Release Pages页面:https://github.com/NaiboWang/EasySpider/releases
|
||||
|
||||
-----v0.3.2-----
|
||||
|
||||
## 更新说明
|
||||
|
80
.temp_to_pub/compress.py
Normal file
80
.temp_to_pub/compress.py
Normal file
@ -0,0 +1,80 @@
|
||||
import glob
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import requests
|
||||
import platform
|
||||
import shutil
|
||||
import zipfile
|
||||
import urllib.request
|
||||
import py7zr
|
||||
|
||||
def compress_folder_to_7z(folder_path, output_file):
|
||||
if os.path.exists(output_file):
|
||||
os.remove(output_file)
|
||||
with py7zr.SevenZipFile(output_file, 'w') as archive:
|
||||
archive.writeall(folder_path, output_file)
|
||||
|
||||
def compress_folder_to_7z_split(folder_path, output_file):
|
||||
if os.path.exists(output_file):
|
||||
os.remove(output_file)
|
||||
file_name = os.path.basename(output_file)
|
||||
file_dir = os.path.dirname(output_file)
|
||||
|
||||
# 获取文件名的前缀
|
||||
file_prefix = os.path.splitext(file_name)[0]
|
||||
|
||||
# 构建分卷文件的路径模式
|
||||
split_file_pattern = os.path.join(file_dir, file_prefix + ".7z.*")
|
||||
|
||||
# 获取匹配的分卷文件列表
|
||||
split_files = glob.glob(split_file_pattern)
|
||||
|
||||
# 删除分卷文件
|
||||
for split_file in split_files:
|
||||
os.remove(split_file)
|
||||
|
||||
# 压缩文件夹
|
||||
subprocess.call(["7z", "a", "-v95m", output_file, folder_path])
|
||||
|
||||
easyspider_version = "0.3.3"
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
if sys.platform == "win32" and platform.architecture()[0] == "64bit":
|
||||
file_name = f"EasySpider_{easyspider_version}_windows_x64.7z"
|
||||
if os.path.exists("./EasySpider_windows_x64/user_data"):
|
||||
shutil.rmtree("./EasySpider_windows_x64/user_data")
|
||||
shutil.rmtree("./EasySpider_windows_x64/Data")
|
||||
shutil.rmtree("./EasySpider_windows_x64/execution_instances")
|
||||
os.mkdir("./EasySpider_windows_x64/Data")
|
||||
os.mkdir("./EasySpider_windows_x64/execution_instances")
|
||||
compress_folder_to_7z_split("./EasySpider_windows_x64", file_name)
|
||||
print(f"Compress {file_name} Split successfully!")
|
||||
compress_folder_to_7z("./EasySpider_windows_x64", file_name)
|
||||
print(f"Compress {file_name} successfully!")
|
||||
elif sys.platform == "win32" and platform.architecture()[0] == "32bit":
|
||||
file_name = f"EasySpider_{easyspider_version}_windows_x86.7z"
|
||||
if os.path.exists("./EasySpider_windows_x86/user_data"):
|
||||
shutil.rmtree("./EasySpider_windows_x86/user_data")
|
||||
shutil.rmtree("./EasySpider_windows_x86/Data")
|
||||
shutil.rmtree("./EasySpider_windows_x86/execution_instances")
|
||||
os.mkdir("./EasySpider_windows_x86/Data")
|
||||
os.mkdir("./EasySpider_windows_x86/execution_instances")
|
||||
compress_folder_to_7z("./EasySpider_windows_x64", file_name)
|
||||
print(f"Compress {file_name} successfully!")
|
||||
elif sys.platform == "linux" and platform.architecture()[0] == "64bit":
|
||||
file_name = f"EasySpider_{easyspider_version}_Linux_x64.7z"
|
||||
if os.path.exists("./EasySpider_Linux_x64/user_data"):
|
||||
shutil.rmtree("./EasySpider_Linux_x64/user_data")
|
||||
shutil.rmtree("./EasySpider_Linux_x64/Data")
|
||||
shutil.rmtree("./EasySpider_Linux_x64/execution_instances")
|
||||
os.mkdir("./EasySpider_Linux_x64/Data")
|
||||
os.mkdir("./EasySpider_Linux_x64/execution_instances")
|
||||
# compress_folder_to_7z("./EasySpider_Linux_x64", file_name)
|
||||
print(f"Compress {file_name} successfully!")
|
||||
elif sys.platform == "darwin" and platform.architecture()[0] == "64bit":
|
||||
pass
|
||||
|
@ -30,6 +30,9 @@ version = "0.3.3"
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
file_path = "../.temp_to_pub/compress.py"
|
||||
update_file_version(file_path, version, key='easyspider_version = "')
|
||||
|
||||
file_path = "./src/taskGrid/logic.js"
|
||||
update_file_version(file_path, version, key='"version": "')
|
||||
|
||||
|
@ -93,4 +93,4 @@ if __name__ == "__main__":
|
||||
elif sys.platform == "darwin" and platform.architecture()[0] == "64bit":
|
||||
pass
|
||||
|
||||
print("Done!")
|
||||
print("Done and don't forget to generate executestage EXEcutable program!")
|
7
ElectronJS/发布一条龙脚本.md
Normal file
7
ElectronJS/发布一条龙脚本.md
Normal file
@ -0,0 +1,7 @@
|
||||
1. python change_version.py 更改版本号。
|
||||
2. python generate_chrome.py 更新最新的chrome及chromedriver。
|
||||
3. 在ExecuteStage目录下执行generateEXE生成运行阶段可执行文件。
|
||||
4. 在当前目录下执行package_操作系统版本打包。
|
||||
5. 对windows需要额外执行clean_and_release*.cmd打包。
|
||||
6. 在.temp_to_pub目录下执行python compress.py压缩成最终发布包。
|
||||
|
@ -1,2 +0,0 @@
|
||||
- python generate_chrome.py 更新最新的chrome及chromedriver
|
||||
- python change_version.py 更改版本号
|
@ -263,7 +263,7 @@ class BrowserThread(Thread):
|
||||
elif int(codeMode) == 1:
|
||||
self.recordLog("Execute System Call:" + code)
|
||||
self.recordLog("执行系统命令:" + code)
|
||||
# 执行系统命令,超时时间为5秒
|
||||
# 执行系统命令
|
||||
try:
|
||||
# output = subprocess.run(code, capture_output=True, text=True, timeout=max_wait_time, encoding="utf-8", shell=True)
|
||||
output = subprocess.run(code, capture_output=True, text=True, timeout=max_wait_time, shell=True)
|
||||
@ -271,7 +271,7 @@ class BrowserThread(Thread):
|
||||
output = output.stdout
|
||||
print(output)
|
||||
except subprocess.TimeoutExpired:
|
||||
# 命令执行时间超过5秒,抛出异常
|
||||
# 命令执行时间超过指定值,抛出异常
|
||||
self.recordLog("Command timed out")
|
||||
self.recordLog("命令执行超时")
|
||||
except Exception as e:
|
||||
|
Loading…
x
Reference in New Issue
Block a user