qiushang 3 tháng trước cách đây
mục cha
commit
dc6036dfc9
3 tập tin đã thay đổi với 93 bổ sung24 xóa
  1. 3 3
      nsis/test.nsi
  2. 1 1
      package.json
  3. 89 20
      src/renderer/components/home.vue

+ 3 - 3
nsis/test.nsi

@@ -1,16 +1,16 @@
 # ====================== 自定义宏 产品信息==============================
 !define PRODUCT_MID        		    "EkoFCqqaUJXy"
-!define PRODUCT_VERSION        		"2.0.3.1"
+!define PRODUCT_VERSION        		"2.0.3.3"
 !define PRODUCT_NAME           		"星优视频解析下载器"
 !define INSTALL_OUTPUT_NAME    		"XYCaptureVideo_XY.exe" 
 !define EXE_NAME               		"XYCaptureVideo.exe"
 !define PRODUCT_PATHNAME           	"XYCaptureVideo"     #安装卸载项用到的KEY,注册表
 !define INSTALL_APPEND_PATH         "XYCaptureVideo"     #安装路径追加的名称 
-!define APP_DOWNLOAD_URL    		"https://xy.xingyousoft.com/soft/XYCaptureVideo/lastest2.0.3.1.7z"
+!define APP_DOWNLOAD_URL    		"https://xy.xingyousoft.com/soft/XYCaptureVideo/lastest2.0.3.3.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/XYCaptureVideo/uninstallWeb/?v=2.0.3.1"   # 接卸优惠网址
+!define UNINSTALL_url               "https://xy.xingyousoft.com/soft/XYCaptureVideo/uninstallWeb/?v=2.0.3.3"   # 接卸优惠网址
 
 # ====================== 自定义宏 安装信息==============================
 !define INSTALL_7Z_NAME 	   		"app.7z"

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 	"name": "XYCaptureVideo",
-	"version": "2.0.3.1",
+	"version": "2.0.3.3",
 	"author": "苏州星优办公软件有限公司",
 	"description": "An electron-vue project",
 	"license": "captureVideo",

+ 89 - 20
src/renderer/components/home.vue

@@ -21,7 +21,7 @@
 									<img src="../assets/image/cctv.png" class="soft-icon" title="cctv" />
 									<img src="../assets/image/56.png" class="soft-icon" title="56视频" />
 									<img src="../assets/image/acfun.png" class="soft-icon" title="acfun" />
-									等多个平台,<span style="color: #F56C6C;">(建议使用win7以上系统)</span>
+									等多个平台,<span style="color: #F56C6C;">(使用win7以上系统)</span>
 									
 									<el-popover placement="bottom" popper-class="popper-open" trigger="hover" content="会员/付费/版权视频不支持下载">
 										<i class="el-icon-info" slot="reference" style="margin-right: 10px; color: #F56C6C;"></i>
@@ -94,9 +94,10 @@
 										</template>
 									</template>
 								</vxe-column>
-								<vxe-column title="操作" width="120">
+								<vxe-column title="操作" width="150">
 									<template #default="{ row, rowIndex }">
-										<el-button :loading="row.loading" type="danger" size="mini" plain @click="downloadVideo(rowIndex)">点击下载</el-button>
+										<el-button v-if="row.urlList && row.urlList.length > 0" type="danger" size="mini" plain @click="copy(rowIndex)">复制</el-button>
+										<el-button :loading="row.loading" type="danger" size="mini" plain @click="downloadVideo(rowIndex)">下载</el-button>
 									</template>
 								</vxe-column>
 							</vxe-table>
@@ -158,6 +159,32 @@
 						</div>
 					</div>
 				</el-dialog>
+				
+				<!-- 抖音下载 -->
+				<el-dialog title="抖音视频下载" :visible.sync="dyModal" width="300px" :close-on-click-modal="false" :close-on-press-escape="false">
+					<el-divider content-position="left">
+						普通下载
+						<el-popover placement="bottom" popper-class="popper-open" trigger="hover" content="点击复制地址到浏览器中打开">
+							<i class="el-icon-info" slot="reference" style="margin-left: 10px; color: #F56C6C;"></i>
+						</el-popover>
+					</el-divider>
+					<div style="text-align: center;">
+						<el-button v-if="commonUrl" size="small" round type="primary" @click="copyText(commonUrl)">下载地址</el-button>
+					</div>
+					
+					<el-divider content-position="left">
+						迅雷下载
+						<el-popover placement="bottom" popper-class="popper-open" trigger="hover" content="点击复制下载地址到迅雷中下载">
+							<i class="el-icon-info" slot="reference" style="margin-left: 10px; color: #F56C6C;"></i>
+						</el-popover>
+					</el-divider>
+					<div style="text-align: center;">
+						<div v-for="(item, index) in thunderUrl" :key="index">
+							<el-button size="small" round type="primary" @click="copyText(item)" style="margin-bottom: 15px;">下载地址{{index+1}}</el-button>
+							</br>
+						</div>
+					</div>
+				</el-dialog>
 		
 			</el-main>
 			
@@ -235,6 +262,11 @@
 				mergeLoading: false,
 				bUrl: true,
 				
+				dyModal: false,
+				dyIndex: 0,
+				thunderUrl: [],
+				commonUrl: '',
+				
 			};
 		},
 		async mounted() {
@@ -485,18 +517,54 @@
 					})
 				}
 			},
-			
-			// 点击下载视频
-			async downloadVideo(index, flag){
-				this.selectIndex = index;
+			// 复制链接地址
+			copyText(text){
+				navigator.clipboard.writeText(text).then(() => {
+					this.$message({message: '视频下载链接已成功复制到剪贴板', type: 'success'});
+				}).catch(err => {
+					this.$message.error('无法复制文本', err.toString());
+				});
+			},
+			// 点击复制
+			copy(index){
 				let authority = this.$refs.headerRef.authority.isAuthority;
-				if (!authority && !flag) {
+				if (!authority) {
 					this.tipsModal = true;
 					this.tipsDesc = '暂无下载权限,请开通VIP会员使用';
 					return false;
 				}
 				
-				if(!authority && flag){
+				this.commonUrl = '';
+				this.thunderUrl = [];
+				let tag = this.videoList[index].tag;
+				let urlList = this.videoList[index].urlList;
+				let title =  this.videoList[index].title;
+				let text = urlList[0];
+				if(urlList.length <= 0){
+					this.$message.error('无法复制下载地址');
+					return false;
+				}
+				if(tag == 'douyin'){
+					this.dyModal = true;
+					this.dyIndex = index;
+					
+					urlList.map(uitem => {
+						if(uitem.startsWith('https://www.douyin.com/')){
+							this.commonUrl = uitem;
+						}
+						let urlBuffer = Buffer.from(`AA`+uitem +`&filename=`+title+`.mp4ZZ`).toString('base64');
+						this.thunderUrl.push('thunder://'+urlBuffer);
+					})
+				}else{
+					this.copyText(text);
+				}
+			},
+			
+			// 点击下载视频
+			async downloadVideo(index){
+				this.selectIndex = index;
+				let authority = this.$refs.headerRef.authority.isAuthority;
+				if (!authority) {
 					this.tipsModal = true;
 					this.tipsDesc = '暂无下载权限,请开通VIP会员使用';
 					return false;
@@ -512,8 +580,8 @@
 				if(item.tag){ //抖音下载
 					if(item.title){
 						item.title = item.title.substring(0, 50);
-						if(this.containsAnyChar(item.title, ['\\', '/', ':', '*', '?', '"', '<', '>', '|'])){  //判断是否含有特殊字符
-							item.title = item.title.replace(/[\\|/|:|*|?|"|<|>||]/g, "");
+						if(this.containsAnyChar(item.title)){  //判断是否含有特殊字符
+							item.title = item.title.replace(/[\\|/|:|*|?|"|<|>||#|%|&|\s]/g, "");
 						}
 					}
 					let outputPath = newPath + separator + item.title + '[' + item.format_id + ']' + '.mp4';
@@ -653,8 +721,8 @@
 							
 							if(responseObj.preview_title){
 								responseObj.preview_title = responseObj.preview_title.substring(0, 50);
-								if(this.containsAnyChar(responseObj.preview_title, ['\\', '/', ':', '*', '?', '"', '<', '>', '|'])){  //判断是否含有特殊字符
-									responseObj.preview_title = responseObj.preview_title.replace(/[\\|/|:|*|?|"|<|>||]/g, "");
+								if(this.containsAnyChar(responseObj.preview_title)){  //判断是否含有特殊字符
+									responseObj.preview_title = responseObj.preview_title.replace(/[\\|/|:|*|?|"|<|>||#|%|&|\s]/g, "");
 								}
 							}
 							if(responseObj && responseObj.video && responseObj.video.play_addr){
@@ -775,8 +843,8 @@
 										let title = await page.title();
 										if(title){
 											title = title.substring(0, 50);
-											if(this.containsAnyChar(title, ['\\', '/', ':', '*', '?', '"', '<', '>', '|'])){  //判断是否含有特殊字符
-												title = title.replace(/[\\|/|:|*|?|"|<|>||]/g, "");
+											if(this.containsAnyChar(title)){  //判断是否含有特殊字符
+												title = title.replace(/[\\|/|:|*|?|"|<|>||#|%|&|\s]/g, "");
 											}
 										}
 										
@@ -840,8 +908,8 @@
 										let title = await page.title();
 										if(title){
 											title = title.substring(0, 50);
-											if(this.containsAnyChar(title, ['\\', '/', ':', '*', '?', '"', '<', '>', '|'])){  //判断是否含有特殊字符
-												title = title.replace(/[\\|/|:|*|?|"|<|>||]/g, "");
+											if(this.containsAnyChar(title)){  //判断是否含有特殊字符
+												title = title.replace(/[\\|/|:|*|?|"|<|>||#|%|&|\s]/g, "");
 											}
 										}
 										
@@ -962,8 +1030,8 @@
 				let title = await page.title();
 				if(title){
 					title = title.substring(0, 50);
-					if(this.containsAnyChar(title, ['\\', '/', ':', '*', '?', '"', '<', '>', '|'])){  //判断是否含有特殊字符
-						title = title.replace(/[\\|/|:|*|?|"|<|>||]/g, "");
+					if(this.containsAnyChar(title)){  //判断是否含有特殊字符
+						title = title.replace(/[\\|/|:|*|?|"|<|>||#|%|&|\s]/g, "");
 					}
 					if (fs.existsSync(this.downloadDir + separator + pjson.softInfo.softName + separator + title)) {
 						urlInfo.newPath = this.downloadDir + separator + pjson.softInfo.softName + separator + title;
@@ -1018,7 +1086,8 @@
 			},
 			
 			// 是否包含特殊字符
-			containsAnyChar(str, charsArray) {
+			containsAnyChar(str) {
+				let charsArray = ['\\', '/', ':', '*', '?', '"', '<', '>', '|', '#', '%' ,'&'];
 			    for (let i = 0; i < charsArray.length; i++) {
 			        if (str.includes(charsArray[i])) {  
 			            return true;