|
|
@@ -291,14 +291,25 @@ class SearchDomainGUI:
|
|
|
messagebox.showerror("错误", f"输入文件不存在: {input_file}")
|
|
|
return
|
|
|
|
|
|
- # 准备参数
|
|
|
+ # 准备输出文件路径
|
|
|
if not os.path.isabs(output_file):
|
|
|
output_file = os.path.join(self.app_path, output_file)
|
|
|
+
|
|
|
+ # 确保输出目录存在
|
|
|
+ output_dir = os.path.dirname(output_file)
|
|
|
+ if output_dir and not os.path.exists(output_dir):
|
|
|
+ try:
|
|
|
+ os.makedirs(output_dir, exist_ok=True)
|
|
|
+ except Exception as e:
|
|
|
+ messagebox.showerror("错误", f"无法创建输出目录: {output_dir}\n{str(e)}")
|
|
|
+ return
|
|
|
|
|
|
+ # 准备参数
|
|
|
+ # app_path 应该设置为输出文件的目录,因为 saveRes 使用 app_path + output
|
|
|
params = OrderedDict({
|
|
|
- "input": os.path.basename(input_file),
|
|
|
- "output": os.path.basename(output_file),
|
|
|
- "app_path": os.path.dirname(input_file)
|
|
|
+ "input": input_file, # 使用完整路径
|
|
|
+ "output": os.path.basename(output_file), # 只使用文件名
|
|
|
+ "app_path": os.path.dirname(output_file) # 输出文件的目录
|
|
|
})
|
|
|
|
|
|
# 在后台线程中运行
|
|
|
@@ -315,6 +326,7 @@ class SearchDomainGUI:
|
|
|
try:
|
|
|
self.log(f"开始搜索域名...")
|
|
|
self.log(f"输入文件: {params['input']}")
|
|
|
+ self.log(f"输出目录: {params['app_path']}")
|
|
|
self.log(f"输出文件: {params['output']}")
|
|
|
self.log(f"导出所有: {export_all}")
|
|
|
|
|
|
@@ -324,7 +336,16 @@ class SearchDomainGUI:
|
|
|
self.log("域名搜索完成!")
|
|
|
output_path = os.path.join(params["app_path"], params["output"])
|
|
|
self.log(f"结果已保存到: {output_path}")
|
|
|
- messagebox.showinfo("成功", f"域名搜索完成!\n结果已保存到: {output_path}")
|
|
|
+
|
|
|
+ # 验证文件是否真的存在
|
|
|
+ if os.path.exists(output_path):
|
|
|
+ file_size = os.path.getsize(output_path)
|
|
|
+ self.log(f"文件大小: {file_size} 字节")
|
|
|
+ messagebox.showinfo("成功", f"域名搜索完成!\n结果已保存到: {output_path}\n文件大小: {file_size} 字节")
|
|
|
+ else:
|
|
|
+ error_msg = f"警告:输出文件不存在: {output_path}"
|
|
|
+ self.log(error_msg)
|
|
|
+ messagebox.showwarning("警告", error_msg)
|
|
|
|
|
|
except Exception as e:
|
|
|
error_msg = f"搜索域名时出错: {str(e)}"
|