qiushang 1 周之前
父节点
当前提交
50aa8f032f
共有 5 个文件被更改,包括 49 次插入18 次删除
  1. 3 3
      nsis/test.nsi
  2. 1 1
      package.json
  3. 21 1
      src/renderer/components/header.vue
  4. 23 12
      src/renderer/components/home.vue
  5. 1 1
      src/renderer/utils/electronApi.js

+ 3 - 3
nsis/test.nsi

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

+ 1 - 1
package.json

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

+ 21 - 1
src/renderer/components/header.vue

@@ -139,6 +139,15 @@
 					<el-button size="mini" @click="toLogin('kuaishou')" :loading="kuaishouLoading">快手</el-button>
 					<el-button size="mini" @click="toLogin('weibo')" :loading="weiboLoading">微博</el-button>
 				</el-row>
+				<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>
+				<el-row>
+					<div style="padding-bottom: 10px;">启用代理:<el-switch v-model="isAgent" active-value="1" inactive-value="-1"></el-switch></div>
+					<el-input placeholder="可为空,不会设置请咨询客服" v-model="weiboAgent" clearable size="small"></el-input>
+				</el-row>
 				<el-divider content-position="left">清理缓存</el-divider>
 				<el-row style="text-align: center;">
 					<el-button size="small" type="primary" @click="clearCache()" :loading="cacheLoading">点击清除软件缓存</el-button>
@@ -277,6 +286,9 @@
 				isRead: false,
 				noticeValue: {},
 				noticeModel: false,
+				
+				isAgent: '1',
+				weiboAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36',
 			}
 		},
         props: {
@@ -289,6 +301,12 @@
 			if(this.$utils.getStorage('userInfo')){
 				this.userInfo = this.$utils.getStorage('userInfo');
 			}
+			if(this.$utils.getStorage('weiboAgent')){
+				this.weiboAgent = this.$utils.getStorage('weiboAgent');
+			}
+			if(this.$utils.getStorage('isAgent')){
+				this.isAgent = this.$utils.getStorage('isAgent');
+			}
 			
 			window.addEventListener('message', e => {
 				if (e.origin === 'https://www.xingyousoft.com') {
@@ -458,7 +476,9 @@
 			saveSetting(){
 				this.saveLoading = true;
 				this.$utils.setStorage('closeType', this.closeType);
-				this.$utils.setStorage('isRemember', true)
+				this.$utils.setStorage('isRemember', true);
+				this.$utils.setStorage('weiboAgent', this.weiboAgent);
+				this.$utils.setStorage('isAgent', this.isAgent);
 				ipcRenderer.send('boot', this.boot);
 				setTimeout(() => {
 					this.saveLoading = false;

+ 23 - 12
src/renderer/components/home.vue

@@ -353,9 +353,7 @@
 	const axios = require('axios');
 	const StealthPlugin = require('puppeteer-extra-plugin-stealth');
 	const { ipcRenderer } = require('electron');
-	const fakeUa = require('fake-useragent');
-	const userStr = fakeUa();
-	console.log(userStr);
+
 	let separator = '';
 	if (os.platform == 'linux') {
 		separator = '/'
@@ -430,6 +428,11 @@
 				this.downloadDir = homedir + separator + "Downloads"
 			}
 			
+			let dir = this.$utils.getStorage('downloadDir');
+			if(dir){
+				this.downloadDir = dir;
+			}
+			
 			if (!fs.existsSync(os.tmpdir() + separator + 'chrome-data-capture-video')) {
 				fs.mkdirSync(os.tmpdir() + separator + 'chrome-data-capture-video');
 			}
@@ -456,7 +459,6 @@
 				// 发送事件到主进程,附带元素类型信息
 				ipcRenderer.send('show-context-menu', 'input');
 			});
-			
 		},
 		methods: {
 			// 实时获取开发者设置
@@ -485,6 +487,16 @@
 				let chromePath = puppeteer.executablePath().replace('win32-1', 'win64-1');
 				return chromePath;
 			},
+			// 实时获取代理设置-微博
+			initAgent(){
+				let weiboAgent = this.$utils.getStorage('weiboAgent');
+				let isAgent = this.$utils.getStorage('isAgent');
+				if(isAgent == -1){ // 关闭代理
+					return '';
+				}else{
+					return weiboAgent;
+				}
+			},
 			checkAuthority(){
 				let authority = this.$refs.headerRef.authority;
 				this.$refs.imgRef.authority = authority;
@@ -495,6 +507,7 @@
 				electronApi.call('pickDir', []).then((path) => {
 					if (path) {
 						this.downloadDir = path;
+						this.$utils.setStorage('downloadDir', path);
 					}
 				});
 			},
@@ -715,10 +728,6 @@
 					// console.log(err);
 				})
 				
-				
-				
-				
-				
 			},
 			biliDetail(row){
 				this.biliInfo = row;
@@ -808,10 +817,11 @@
 					this.selectIndex = -1;
 					this.videoList = [];
 					let userAgent = [];
-					if(formatUrl.indexOf('weibo.com/') > -1){
+					let setingAgent = this.initAgent();
+					if(formatUrl.indexOf('weibo.com/') > -1 && setingAgent){
 						userAgent = [
 							'--add-header',
-							'User-Agent:Mozilla/5.0 (Windows NT 11.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.6998.166 Safari/537.36',
+							'User-Agent:'+setingAgent,
 							'--add-header',
 							"Referer:https://weibo.com/"
 						];
@@ -965,10 +975,11 @@
 						return false;
 					}else{
 						let userAgent = [];
-						if(this.downloadUrl.indexOf('weibo.com/') > -1){
+						let setingAgent = this.initAgent();
+						if(this.downloadUrl.indexOf('weibo.com/') > -1 && setingAgent){
 							userAgent = [
 								'--add-header',
-								'User-Agent:Mozilla/5.0 (Windows NT 11.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.6998.166 Safari/537.36',
+								'User-Agent:'+setingAgent,
 								'--add-header',
 								"Referer:https://weibo.com/"
 							];

+ 1 - 1
src/renderer/utils/electronApi.js

@@ -77,7 +77,7 @@ window.electron_api = {
             proc = child_process.spawn(cmd, cmds.slice(1), opts);
         }
 
-        console.log(cmds.join(' '))
+        // console.log(cmds.join(' '))
 
         return new Promise(function (resolve, reject) {
             let stdout = [];