qiushang il y a 1 semaine
Parent
commit
11bbaed238

+ 3 - 3
nsis/test.nsi

@@ -1,16 +1,16 @@
 # ====================== 自定义宏 产品信息==============================
 !define PRODUCT_MID        		    "Ds8JqlRmiiGR"
-!define PRODUCT_VERSION        		"2.3.3.0"
+!define PRODUCT_VERSION        		"2.3.3.1"
 !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.3.3.0.7z"
+!define APP_DOWNLOAD_URL    		"https://xy.xingyousoft.com/soft/XYCapture/lastest2.3.3.1.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.3.3.0"   # 接卸优惠网址
+!define UNINSTALL_url               "https://xy.xingyousoft.com/soft/XYCapture/uninstallWeb/?v=2.3.3.1"   # 接卸优惠网址
 
 # ====================== 自定义宏 安装信息==============================
 !define INSTALL_7Z_NAME 	   		"app.7z"

+ 1 - 1
package.json

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

BIN
src/renderer/assets/image/m-dy.png


BIN
src/renderer/assets/image/m-goofish.png


+ 25 - 2
src/renderer/components/header.vue

@@ -126,7 +126,7 @@
 		</el-dialog>
 		
 		<!-- 软件设置 -->
-		<el-dialog title="软件设置" :visible.sync="settingModal" width="420px">
+		<el-dialog custom-class="setting-dialog" title="软件设置" :visible.sync="settingModal" width="420px">
 			<div>
 				<el-divider content-position="left">
 					账号登录
@@ -170,6 +170,15 @@
 					</el-radio-group>
 				</el-row>
 				<el-divider content-position="left">
+					任务间隔时间
+					<el-popover placement="bottom" popper-class="popper-open" trigger="hover" content="默认为1秒,加大下载间隔时间减少访问频率,降低风控风险">
+						<i class="el-icon-info" slot="reference" style="margin-left: 10px; color: #F56C6C;"></i>
+					</el-popover>
+				</el-divider>
+				<el-row style="text-align: center;">
+					<el-input-number v-model="gap" :min="1" :max="60" label="间隔时间" size="mini" style="margin-right: 5px;"></el-input-number>秒
+				</el-row>
+				<el-divider content-position="left">
 					页面滚动速度
 					<el-popover placement="bottom" popper-class="popper-open" trigger="hover" content="默认600ms,本地网路访问速度快可选择短时间,时间越长处理任务的时间也越长">
 						<i class="el-icon-info" slot="reference" style="margin-left: 10px; color: #F56C6C;"></i>
@@ -177,6 +186,7 @@
 				</el-divider>
 				<el-row style="text-align: center;">
 					<el-select v-model="pageMs" placeholder="请选择时间" size="mini" style="width: 100px; margin-right: 5px;">
+						<el-option :value="300"></el-option>
 						<el-option :value="400"></el-option>
 						<el-option :value="500"></el-option>
 						<el-option :value="600"></el-option>
@@ -185,7 +195,8 @@
 						<el-option :value="900"></el-option>
 						<el-option :value="1000"></el-option>
 						<el-option :value="1200"></el-option>
-					</el-select>ms
+						<el-option :value="1400"></el-option>
+					</el-select>毫秒
 				</el-row>
 				<el-divider content-position="left">清理缓存</el-divider>
 				<el-row style="text-align: center;">
@@ -273,6 +284,7 @@
 				versionType: 2,
 				chromeType: 2,
 				chromePath: '',
+				gap: 1,
 				pageMs: 600,
 				isRemember:true,
 				//
@@ -562,6 +574,7 @@
 			setPublic(){
 				this.$utils.setStorage('closeType', this.closeType);
 				this.$utils.setStorage('pageMs', this.pageMs);
+				this.$utils.setStorage('gap', this.gap);
 				this.$utils.setStorage('versionType', this.versionType);
 				this.$utils.setStorage('isRemember', true);
 				this.$utils.setStorage('chromeType', this.chromeType);
@@ -885,6 +898,7 @@
 					// 获取设置
 					let closeType = this.$utils.getStorage('closeType');
 					let pageMs = this.$utils.getStorage('pageMs');
+					let gap = this.$utils.getStorage('gap');
 					let versionType = this.$utils.getStorage('versionType');
 					let chromeType = this.$utils.getStorage('chromeType');
 					let chromePath = this.$utils.getStorage('chromePath');
@@ -894,6 +908,9 @@
 					if(pageMs){
 						this.pageMs = pageMs;
 					}
+					if(gap){
+						this.gap = gap;
+					}
 					if(versionType){
 						this.versionType = versionType;
 					}
@@ -956,6 +973,12 @@
 		color: #f8f8f8 !important;
 	}
 	
+	.setting-dialog{
+		.el-dialog__body{
+			padding: 0 20px;
+		}
+	}
+	
 	.member-dialog{
 		.el-dialog__header{
 			padding: 0;

+ 381 - 7
src/renderer/components/home.vue

@@ -38,6 +38,12 @@
 						<el-menu-item index="5">
 							<img src="../assets/image/m-hong.png" class="m-image"/><span slot="title">小红书</span>
 						</el-menu-item>
+						<el-menu-item index="11">
+							<img src="../assets/image/m-goofish.png" class="m-image"/><span slot="title">闲鱼</span>
+						</el-menu-item>
+						<el-menu-item index="12">
+							<img src="../assets/image/m-dy.png" class="m-image"/><span slot="title">抖店</span>
+						</el-menu-item>
 						
 						<el-menu-item index="10">
 							<img src="../assets/image/m-chrome.png" class="m-image"/><span slot="title">其他(Beta)</span>
@@ -69,7 +75,7 @@
 				
 				<soft-img ref="imgRef" v-show="['2-1', '2-2', '2-3', '2-5'].indexOf(menuIndex) > -1" @open-vip="openVip" @check-authority="checkAuthority"></soft-img>
 				
-				<el-main v-show="['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'].indexOf(menuIndex) > -1" ref="el-main" style="background-color: #fafafa;">
+				<el-main v-show="['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'].indexOf(menuIndex) > -1" ref="el-main" style="background-color: #fafafa;">
 					<template>
 						<div class="content-top">
 							<div>
@@ -116,6 +122,8 @@
 										<span v-if="menuIndex == '8'">亚马逊 - </span>
 										<span v-if="menuIndex == '9'">拼多多 - </span>
 										<span v-if="menuIndex == '10'">网页 - </span>
+										<span v-if="menuIndex == '11'">闲鱼 - </span>
+										<span v-if="menuIndex == '12'">抖店 - </span>
 										图片下载
 									</h3>
 									<el-link v-if="menuIndex == '5'" :underline="false" type="danger" style="text-align: center; font-size: 12px;">
@@ -149,12 +157,12 @@
 										<el-checkbox :value="true" style="opacity: 0.6; cursor: not-allowed;">图片</el-checkbox>
 									</div>
 									
-									<div v-if="['1', '2', '3', '4', '6', '7', '8', '9'].indexOf(menuIndex) > -1" style="padding-top: 10px;">
+									<div v-if="['1', '2', '3', '4', '6', '7', '8', '9', '11', '12'].indexOf(menuIndex) > -1" style="padding-top: 10px;">
 										<label>下载类型:</label>
 										<el-checkbox-group :min="1" v-model="settingArr" style="display: inline-block;" @input="settingGroup">
 											<el-checkbox label="mainImg">主图</el-checkbox>
-											<el-checkbox label="detailImg">详情图</el-checkbox>
-											<el-checkbox label="skuImg" v-if="menuIndex != '7'">SKU图</el-checkbox>
+											<el-checkbox label="detailImg" v-if="menuIndex != '11'">详情图</el-checkbox>
+											<el-checkbox label="skuImg" v-if="menuIndex != '7' && menuIndex != '11' && menuIndex != '12'">SKU图</el-checkbox>
 											<el-checkbox label="commentImg" v-if="menuIndex == '3' || menuIndex == '4'">评论图</el-checkbox>
 											<el-checkbox label="video">主图视频</el-checkbox>
 										</el-checkbox-group>
@@ -213,6 +221,7 @@
 											<el-button size="mini" type="warning" :loading="checkLoading" style="margin-left: 10px;" :disabled='pddStatus == 2' @click="checkPddLogin">检测登录状态</el-button>
 										</div>
 									</template>
+									
 								</el-row>
 							</div>
 						
@@ -363,7 +372,7 @@
 	// import puppeteer from 'puppeteer'
 	import puppeteer from 'puppeteer-extra'
 	const StealthPlugin = require('puppeteer-extra-plugin-stealth');
-	const listNameArr = ['alibaba','jd','tmall','tb','red','aliguoji','acaigou','amazon', 'pdd' ,'common'];
+	const listNameArr = ['alibaba','jd','tmall','tb','red','aliguoji','acaigou','amazon', 'pdd' ,'common','goofish','dy'];
 	// const headless = true;
 	// const waitUntil = 'networkidle2';
 	const { ipcRenderer } = require('electron');
@@ -418,6 +427,8 @@
 				tmallList: [],
 				redList: [],
 				pddList: [],
+				goofishList: [],
+				dyList: [],
 				commonList: [],
 				productName: pjson.softInfo.softName,
 				imgUrl: this.$api.imgUrl,
@@ -430,7 +441,8 @@
 					video: false,
 				},
 				exampleUrl: ['https://www.1688.com', 'https://www.jd.com', 'https://www.tmall.com', 'https://www.taobao.com', 'https://www.xiaohongshu.com', 
-				'https://www.alibaba.com', 'https://b2b.baidu.com', 'https://www.amazon.com', 'https://mobile.yangkeduo.com/goods.html', 'https://www.example.com'],
+				'https://www.alibaba.com', 'https://b2b.baidu.com', 'https://www.amazon.com', 'https://mobile.yangkeduo.com/goods.html', 'https://www.example.com',
+				'https://www.goofish.com', 'https://v.douyin.com/xxxxxx/'],
 
 				fileList: [],
 				
@@ -459,6 +471,8 @@
 				commonBrowser: null,
 				redBrowser: null,
 				pddBrowser: null,
+				goofishBrowser: null,
+				dyBrowser: null,
 				loginBrowser: null, // 登录用的浏览器实例
 				skipLogin: false,
 				pauseFlag: true, //暂停中止标志
@@ -596,6 +610,15 @@
 					return 600;
 				}
 			},
+			// 任务下载间隔时间
+			initGap(){
+				let gap = this.$utils.getStorage('gap');
+				if(gap){
+					return Number(gap);
+				}else{
+					return 0;
+				}
+			},
 			// 实时获取淘宝的开发者设置
 			initDevelop(){
 				let develop = {
@@ -902,7 +925,15 @@
 				}
 				let authority = this.$refs.headerRef.authority.isAuthority;
 				if (!fs.existsSync(this.downloadDir + separator + pjson.softInfo.softName)) {
-					fs.mkdirSync(this.downloadDir + separator + pjson.softInfo.softName);
+					try{
+						fs.mkdirSync(this.downloadDir + separator + pjson.softInfo.softName);
+					}catch(e){
+						this.$notify.error({
+							title: '保存目录不存在!- 1',
+							message: '请重新设置保存目录路径'
+						});
+						return false;
+					}
 				}
 				
 				let index = Number(this.menuIndex) - 1;
@@ -1070,6 +1101,12 @@
 							case '10': // 普通网址
 								task = this.normalDownload(item, this.commonBrowser);
 								break;
+							case '11': // 闲鱼
+								task = this.goofishDownload(item, this.goofishBrowser);
+								break;
+							case '12': // 抖店
+								task = this.dyDownload(item, this.dyBrowser);
+								break;
 						}
 						
 						if(this.pauseFlag){ //暂停跳出循环
@@ -1112,6 +1149,16 @@
 				}
 			},
 			
+			// 通用的延迟函数
+			async delay() {
+				let s = this.initGap();
+				if(s > 0){
+					return new Promise(resolve => setTimeout(resolve, Number(s)*1000));
+				}else{
+					return null;
+				}
+			},
+			
 			// 10-普通网址下载
 			async normalDownload(urlInfo, commonBrowser){
 				let task = await new Promise((resolve,reject) =>{
@@ -1224,6 +1271,7 @@
 									clearInterval(scrollInt);
 									await page.close();
 									urlInfo.status = '4';
+									await this.delay();
 									resolve(true);
 									this.loading = false;
 								}
@@ -1373,6 +1421,7 @@
 									}
 									this.loading = false;
 									urlInfo.status = '4';
+									await this.delay();
 									resolve(true);
 								}
 							}, scrollTime);
@@ -1776,6 +1825,7 @@
 									/**end**/
 									await page.close();
 									urlInfo.status = '4';
+									await this.delay();
 									resolve(true);
 									this.loading = false;
 								}
@@ -2265,6 +2315,7 @@
 									
 									await page.close();
 									urlInfo.status = '4';
+									await this.delay();
 									resolve(true);
 									this.loading = false;
 								}
@@ -2656,6 +2707,7 @@
 							
 							await page.close();
 							urlInfo.status = '4';
+							await this.delay();
 							resolve(true);
 							this.loading = false;
 						}catch(e){
@@ -3449,6 +3501,324 @@
 							
 							await page.close();
 							urlInfo.status = '4';
+							await this.delay();
+							resolve(true);
+							this.loading = false;
+						}catch(e){
+							urlInfo.status = '5';
+							reject(e);
+							this.showError(e);
+						}
+					})();
+				});
+			},
+			
+			// 10-闲鱼图片下载
+			async goofishDownload(urlInfo, pddBrowser){
+				let task = await new Promise((resolve,reject) =>{
+					(async () => {
+						try{
+							let authority = this.$refs.headerRef.authority.isAuthority;
+							let number = 0;
+							urlInfo.status = '2';
+							urlInfo.num = 0;
+							const page = await pddBrowser.newPage();
+							await page.goto(urlInfo.url, {waitUntil : 'networkidle2'});
+							
+							if(urlInfo.title){
+								if (fs.existsSync(this.downloadDir + separator + pjson.softInfo.softName + separator + urlInfo.title)) {
+									urlInfo.newPath = this.downloadDir + separator + pjson.softInfo.softName + separator + urlInfo.title;
+								} else {
+									fs.mkdirSync(this.downloadDir + separator + pjson.softInfo.softName + separator + urlInfo.title);
+									urlInfo.newPath = this.downloadDir + separator + pjson.softInfo.softName + separator + urlInfo.title;
+								}
+							}else{
+								await this.getTitle(page, urlInfo); // 生成页面标题对应的文件夹
+							}
+							urlInfo.status = '3';
+							
+							//detailImg:详情图;skuImg:sku图片;commentImg: 评论图;video: 视频
+							const imgInfo = await page.evaluate((authority, execNum) => {
+								let outObj = {
+									mainImg: [],
+									detailImg: [],
+									skuImg: [],
+									commentImg: [],
+									video: [],
+									skuName: []
+								};
+								
+								//主图 
+								let arr1 = document.querySelectorAll('div[class^=carousel-container] img[class*=ant-image-img]')
+								for(let i=0; i< arr1.length; i++){
+									// if(i > 0 && i < arr1.length-1){ // 去掉首尾重复
+									let mainImgUrl = arr1[i].src || arr1[i].dataset.src;
+									if(outObj.mainImg.indexOf(mainImgUrl) == -1){
+										if(!authority && i < execNum){
+											outObj.mainImg.push(mainImgUrl);
+										}
+										if(authority){
+											outObj.mainImg.push(mainImgUrl);
+										}
+									}
+									// }
+								}
+								
+								// 视频
+								let arr5 = document.querySelectorAll('video source');
+								if(arr5.length == 0){
+									arr5 = document.querySelectorAll('video');
+								}
+								for(let i=0; i< arr5.length; i++){
+									if(outObj.video.indexOf(arr5[i].src) == -1){
+										if(!authority && i < execNum){
+											outObj.video.push(arr5[i].src);
+										}
+										if(authority){
+											outObj.video.push(arr5[i].src);
+										}
+									}
+								}
+								return outObj;
+							}, authority, this.execNum);
+							
+							// 主图下载
+							if(this.settingArr.indexOf('mainImg') > -1){
+								for(let j = 0; j < imgInfo.mainImg.length; j++){
+									let imgUrl = imgInfo.mainImg[j];
+									let queryIndex = imgInfo.mainImg[j].indexOf('?');
+									if (queryIndex !== -1) {
+										imgUrl = imgUrl.substr(0, queryIndex);
+									}
+									let fileName = imgUrl.split('/').pop();
+									let num = Number(j) + 1;
+									let suffix = '.jpg';
+									if(fileName.lastIndexOf('.') > -1){
+										suffix = fileName.substr(fileName.lastIndexOf('.'));
+									}
+									if(suffix == '.webp'){
+										suffix = '.jpg';
+									}
+									
+									if (!fs.existsSync(urlInfo.newPath + '\\主图')) {
+										fs.mkdirSync(urlInfo.newPath + '\\主图');
+									}
+									
+									let outputPath = urlInfo.newPath + '\\主图\\主图' + num + suffix;
+									await this.downloadImage(imgInfo.mainImg[j], outputPath, urlInfo);
+								}
+							}
+							
+							//视频下载
+							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 + '.mp4';
+										await this.downloadImage(imgInfo.video[j], outputPath, urlInfo);
+									}
+								}
+							}
+							
+							await page.close();
+							urlInfo.status = '4';
+							await this.delay();
+							resolve(true);
+							this.loading = false;
+						}catch(e){
+							urlInfo.status = '5';
+							reject(e);
+							this.showError(e);
+						}
+					})();
+				});
+			},
+			
+			// 12-抖店图片下载
+			async dyDownload(urlInfo, pddBrowser){
+				let task = await new Promise((resolve,reject) =>{
+					(async () => {
+						try{
+							let authority = this.$refs.headerRef.authority.isAuthority;
+							let number = 0;
+							urlInfo.status = '2';
+							urlInfo.num = 0;
+							const page = await pddBrowser.newPage();
+							await page.goto(urlInfo.url, {waitUntil : 'networkidle2'});
+							
+							if(urlInfo.title){
+								if (fs.existsSync(this.downloadDir + separator + pjson.softInfo.softName + separator + urlInfo.title)) {
+									urlInfo.newPath = this.downloadDir + separator + pjson.softInfo.softName + separator + urlInfo.title;
+								} else {
+									fs.mkdirSync(this.downloadDir + separator + pjson.softInfo.softName + separator + urlInfo.title);
+									urlInfo.newPath = this.downloadDir + separator + pjson.softInfo.softName + separator + urlInfo.title;
+								}
+							}else{
+								// 获取商品标题
+								let titleHandle = await page.$$('div.title-info');
+								if(titleHandle && titleHandle.length > 0){
+									let titleValue = await page.$eval('div.title-info', el => el.innerText);
+									await this.getTitle(page, urlInfo, titleValue); // 生成页面标题对应的文件夹
+								}else{
+									await this.getTitle(page, urlInfo, '抖店商品-'+new Date().getTime()); // 生成页面标题对应的文件夹
+								}
+							}
+							urlInfo.status = '3';
+							
+							// 被限制验证码拦截
+							let notSale = await page.$$('#captcha_container');
+							if(notSale && notSale.length > 0){
+								await page.close();
+								urlInfo.status = '6';
+								resolve(true);
+								this.loading = false;
+								return false;
+							}
+							
+							//detailImg:详情图;skuImg:sku图片;commentImg: 评论图;video: 视频
+							const imgInfo = await page.evaluate((authority, execNum) => {
+								let outObj = {
+									mainImg: [],
+									detailImg: [],
+									skuImg: [],
+									commentImg: [],
+									video: [],
+									skuName: []
+								};
+								
+								let skuHandle = document.querySelector('img[class*=video__play-icon]');
+								if(skuHandle){
+									skuHandle.click({force: true});
+								}
+								
+								//主图 
+								let arr1 = document.querySelectorAll('div[class*=swiper-slide] div');
+								if(arr1.length == 0){
+									arr1 = document.querySelectorAll('div[class^=head-figure__media-view]');
+								}
+								for(let i=0; i< arr1.length; i++){
+									let mainImgUrl = window.getComputedStyle(arr1[i]).backgroundImage.replace(/url\(["']?(.+?)["']?\)/i, '$1');
+									if(outObj.mainImg.indexOf(mainImgUrl) == -1){
+										if(!authority && i < execNum){
+											outObj.mainImg.push(mainImgUrl);
+										}
+										if(authority){
+											outObj.mainImg.push(mainImgUrl);
+										}
+									}
+								}
+								
+								//详情图 
+								let arr3 = document.querySelectorAll('div[class=product-big-img-list] img');
+								if(arr3.length == 0){
+									arr3 = document.querySelectorAll('div[class=partial-detail-wrapper] img');
+									if(arr3.length == 0){
+										arr3 = document.querySelectorAll('img[class^=product-big-img-list]');
+									}
+								}
+								for(let i=0; i< arr3.length; i++){
+									let detailImgUrl = arr3[i].src || arr3[i].dataset.src;
+									if(!authority && i < execNum){
+										outObj.detailImg.push(detailImgUrl);
+									}
+									if(authority){
+										outObj.detailImg.push(detailImgUrl);
+									}
+									
+								}
+								
+								// 视频
+								let arr5 = document.querySelectorAll('video');
+								for(let i=0; i< arr5.length; i++){
+									if(outObj.video.indexOf(arr5[i].src) == -1){
+										if(!authority && i < execNum){
+											outObj.video.push(arr5[i].src);
+										}
+										if(authority){
+											outObj.video.push(arr5[i].src);
+										}
+									}
+								}
+								return outObj;
+							}, authority, this.execNum);
+							
+							// 主图下载
+							if(this.settingArr.indexOf('mainImg') > -1){
+								for(let j = 0; j < imgInfo.mainImg.length; j++){
+									let imgUrl = imgInfo.mainImg[j];
+									let queryIndex = imgInfo.mainImg[j].indexOf('?');
+									if (queryIndex !== -1) {
+										imgUrl = imgUrl.substr(0, queryIndex);
+									}
+									let fileName = imgUrl.split('/').pop();
+									let num = Number(j) + 1;
+									let suffix = '.jpg';
+									if(fileName.lastIndexOf('.') > -1){
+										suffix = fileName.substr(fileName.lastIndexOf('.'));
+									}
+									if(suffix == '.webp'){
+										suffix = '.jpg';
+									}
+									
+									if (!fs.existsSync(urlInfo.newPath + '\\主图')) {
+										fs.mkdirSync(urlInfo.newPath + '\\主图');
+									}
+									
+									let outputPath = urlInfo.newPath + '\\主图\\主图' + num + suffix;
+									await this.downloadImage(imgInfo.mainImg[j], outputPath, urlInfo);
+								}
+							}
+							
+							//详情图下载
+							if(this.settingArr.indexOf('detailImg') > -1){
+								for(let j = 0; j < imgInfo.detailImg.length; j++){
+									let imgUrl = imgInfo.detailImg[j];
+									let queryIndex = imgInfo.detailImg[j].indexOf('?');
+									if (queryIndex !== -1) {
+										imgUrl = imgUrl.substr(0, queryIndex);
+									}
+									let fileName = imgUrl.split('/').pop();
+									let num = Number(j) + 1;
+									let suffix = '.jpg';
+									if(fileName.lastIndexOf('.') > -1){
+										suffix = fileName.substr(fileName.lastIndexOf('.'));
+									}
+									
+									if (!fs.existsSync(urlInfo.newPath + '\\详情图')) {
+										fs.mkdirSync(urlInfo.newPath + '\\详情图');
+									}
+									
+									let outputPath = urlInfo.newPath + '\\详情图\\详情图' + num + suffix;
+									await this.downloadImage(imgInfo.detailImg[j], outputPath, urlInfo);
+								}
+							}
+							
+							//视频下载
+							if(this.settingArr.indexOf('video') > -1){
+								for(let j = 0; j < imgInfo.video.length; j++){
+									let fileName = imgInfo.video[j].split('/').pop();
+									if(fileName){
+										if (!fs.existsSync(urlInfo.newPath + '\\视频')) {
+											fs.mkdirSync(urlInfo.newPath + '\\视频');
+										}
+										let outputPath = urlInfo.newPath + '\\视频\\视频.mp4' ;
+										await this.downloadImage(imgInfo.video[j], outputPath, urlInfo);
+									}
+								}
+							}
+							
+							await page.close();
+							urlInfo.status = '4';
+							await this.delay();
 							resolve(true);
 							this.loading = false;
 						}catch(e){
@@ -3850,4 +4220,8 @@
 		}
 	}
 	
+	.el-menu-item{
+		height: 45px !important;
+		line-height: 45px !important;
+	}
 </style>