qiushang 2 өдөр өмнө
parent
commit
23edcbe8ae

+ 3 - 3
nsis/test.nsi

@@ -1,16 +1,16 @@
 # ====================== 自定义宏 产品信息==============================
 !define PRODUCT_MID        		    "Ds8JqlRmiiGR"
-!define PRODUCT_VERSION        		"2.4.0.0"
+!define PRODUCT_VERSION        		"2.4.2.0"
 !define PRODUCT_NAME           		"星优图片下载助手"
 !define INSTALL_OUTPUT_NAME    		"XYCapture_XY.exe" 
 !define EXE_NAME               		"XYCapture.exe"
 !define PRODUCT_PATHNAME           	"XYCapture"     #安装卸载项用到的KEY,注册表
 !define INSTALL_APPEND_PATH         "XYCapture"     #安装路径追加的名称 
-!define APP_DOWNLOAD_URL    		"https://xy.xingyousoft.com/soft/XYCapture/lastest2.4.0.0.7z"
+!define APP_DOWNLOAD_URL    		"https://xy.xingyousoft.com/soft/XYCapture/lastest2.4.2.0.7z"
 !define PRODUCT_PUBLISHER      	    "苏州星优办公软件有限公司"
 !define PRODUCT_LEGAL          	    "苏州星优办公软件有限公司"
 !define STATISTICS_url              "https://www.xingyousoft.com/api/index/user_log"   # 统计网址
-!define UNINSTALL_url               "https://xy.xingyousoft.com/soft/XYCapture/uninstallWeb/?v=2.4.0.0"   # 接卸优惠网址
+!define UNINSTALL_url               "https://xy.xingyousoft.com/soft/XYCapture/uninstallWeb/?v=2.4.2.0"   # 接卸优惠网址
 
 # ====================== 自定义宏 安装信息==============================
 !define INSTALL_7Z_NAME 	   		"app.7z"

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 	"name": "XYCapture",
-	"version": "2.4.0.0",
+	"version": "2.4.2.0",
 	"author": "苏州星优办公软件有限公司",
 	"description": "An electron-vue project",
 	"license": "capture",

+ 51 - 32
src/renderer/components/home.vue

@@ -1595,10 +1595,14 @@
 								
 									let detailUrl = '';
 									let videoUrl = '';
-									if(response.url().indexOf('/description/') > -1){ // 商品详情接口  
+									if(response.url().indexOf('pc_item_getWareGraphic') > -1){ // 商品详情接口  
 										detailUrl = response.url();
 									}
 									
+									if(response.headers()['content-type'] == 'video/mp4'){
+										videoUrl = response.url();
+									}
+									
 									if(response.url().indexOf('/tencent/video_v3') > -1){ // 商品视频接口
 										videoUrl = response.url();
 									}
@@ -1614,9 +1618,9 @@
 											let detailInfo = JSON.parse(data);
 											let regex = /\/\/img[0-9]+.360buyimg.com\S+.(jpg|jpeg|png|gif|avif|tif|tiff)/g;
 											let detailImgArr = [];
-											if(detailInfo && detailInfo.content){
-												if(detailInfo.content.match(regex)){
-													detailImgArr = detailInfo.content.match(regex);
+											if(detailInfo && detailInfo.data.graphicContent){
+												if(detailInfo.data.graphicContent.match(regex)){
+													detailImgArr = detailInfo.data.graphicContent.match(regex);
 												}
 											}
 											
@@ -1658,31 +1662,7 @@
 									}
 									
 									if(videoUrl && this.settingArr.indexOf('video') > -1){ // jd商品视频
-										try {
-											let data = await response.text();
-											data = data.slice(0, -1).replace(/^jQuery[0-9]+\(/, '');
-											let videoInfo = JSON.parse(data);
-											let videoUrl = videoInfo.playUrl;
-											jdImgInfo.video.push(videoUrl);
-											
-											let fileName = videoUrl.split('/').pop();
-											if(fileName){
-												let queryIndex = fileName.indexOf('?');
-												if (queryIndex !== -1) {
-													fileName = fileName.substr(0, queryIndex);  
-												}
-												
-												if (!fs.existsSync(urlInfo.newPath + '\\视频')) {
-													fs.mkdirSync(urlInfo.newPath + '\\视频');
-												}
-												
-												let outputPath = urlInfo.newPath + '\\视频\\' + fileName;
-												await this.downloadImage(videoUrl, outputPath, urlInfo);
-											}
-											
-										} catch (error) {  
-											console.error('视频解析失败:', error);  
-										}
+										jdImgInfo.video.push(videoUrl);
 									}
 								}
 								
@@ -1732,10 +1712,18 @@
 										let outObj = {
 											mainImg: [],
 											skuImg: [],
-											detailImg: []
+											detailImg: [],
+											video: []
 										};
 										//主图 
-										let arr1 = document.querySelectorAll('#spec-list img');
+										let arr1 = document.querySelectorAll('.thumbnails img[class*=image]');
+										if(arr1.length == 0){
+											arr1 = document.querySelectorAll('.thumbnails img');
+										}
+										if(arr1.length == 0){
+											arr1 = document.querySelectorAll('#spec-list img');
+										}
+										
 										for(let i=0; i< arr1.length; i++){
 											let mainImgUrl = arr1[i].src;
 											let reg = /\/n[0-9]+\/jfs\//;
@@ -1785,6 +1773,14 @@
 											}
 										}
 										
+										// 视频
+										let arr4 = document.querySelectorAll('video');
+										for(let i=0; i< arr4.length; i++){
+											if(outObj.video.indexOf(arr4[i].src) == -1){
+												outObj.video.push(arr4[i].src);
+											}
+										}
+										
 										return outObj;
 									}, authority, this.execNum);
 									
@@ -1840,6 +1836,26 @@
 										}
 									}
 									
+									//视频下载
+									if(this.settingArr.indexOf('video') > -1){
+										for(let j = 0; j < imgInfo.video.length; j++){
+											let fileName = imgInfo.video[j].split('/').pop();
+											if(fileName){
+												let queryIndex = fileName.indexOf('?');
+												if (queryIndex !== -1) {
+													fileName = fileName.substr(0, queryIndex);  
+												}
+												
+												if (!fs.existsSync(urlInfo.newPath + '\\视频')) {
+													fs.mkdirSync(urlInfo.newPath + '\\视频');
+												}
+												
+												let outputPath = urlInfo.newPath + '\\视频\\' + fileName;
+												await this.downloadImage(imgInfo.video[j], outputPath, urlInfo);
+											}
+										}
+									}
+									
 									// 详情图下载 --图书类目
 									if(this.settingArr.indexOf('detailImg') > -1 && jdImgInfo.detailImg.length == 0){
 										for(let j = 0; j < imgInfo.detailImg.length; j++){
@@ -2678,7 +2694,10 @@
 								let regex = /\.(.{3,4})_[0-9a-zA-z]+\.(.{3,4})_\.(.{3,4})/;
 								
 								//主图 
-								let arr1 = document.querySelectorAll('img[class^=note-slider-img]');
+								let arr1 = document.querySelectorAll('.swiper-slide img');
+								if(arr1.length == 0){
+									arr1 = document.querySelectorAll('img[class^=note-slider-img]');
+								}
 								for(let i=0; i< arr1.length; i++){
 									let mainImgUrl = arr1[i].src;
 									let result = regex.exec(mainImgUrl);