2 Commits
2.0.0 ... 2.0.1

Author SHA1 Message Date
putyy
c1f05876e3 优化拦截规则 2024-08-19 16:55:52 +08:00
putyy
2981518cf4 Update README.md 2024-07-24 09:47:48 +08:00
6 changed files with 20 additions and 24 deletions

View File

@@ -38,8 +38,5 @@ Win7无法使用
>> MAC: /Users/你的用户名称/.res-downloader@putyy/res-downloader-installed.lock
>> Win: C:\Users\Admin\.res-downloader@putyy/res-downloader-installed.lock
#### 更多问题见: [issues](https://github.com/putyy/res-downloader/issues)、[爱享论坛](https://s.gowas.cn/d/4089-quan-ping-tai-zi-yuan-xia-zai-ruan-jian-zui-xin-ban-v106/171)
## 免责声明
本软件用于学习研究使用,若因使用本软件造成的一切法律责任均与本人无关!
```

View File

@@ -71,12 +71,12 @@ export async function startServer({win, upstreamProxy, setProxyErrorCallback = f
res.string = 'ok'
res.statusCode = 200
try {
if (!req.json?.description || req.json?.media?.length <= 0) {
if (req.json?.media?.length <= 0) {
return
}
const media = req.json?.media[0]
const url_sign: string = hexMD5(media.url)
if (global.videoList.hasOwnProperty(url_sign) === true) {
if (!media?.decodeKey || global.videoList.hasOwnProperty(url_sign) === true) {
return
}
const urlInfo = urlTool.parse(media.url, true)
@@ -88,7 +88,7 @@ export async function startServer({win, upstreamProxy, setProxyErrorCallback = f
size: media?.fileSize ? toSize(media.fileSize) : 0,
type: "video/mp4",
type_str: 'video',
decode_key: media?.decodeKey ? media?.decodeKey : '',
decode_key: media.decodeKey,
description: req.json.description,
}))
} catch (e) {
@@ -114,6 +114,7 @@ export async function startServer({win, upstreamProxy, setProxyErrorCallback = f
proxy.intercept(
{
phase: 'response',
hostname: 'res.wx.qq.com',
as: 'string',
},
async (req, res) => {
@@ -121,14 +122,6 @@ export async function startServer({win, upstreamProxy, setProxyErrorCallback = f
res.string = res.string.replaceAll('.js"', '.js?v=' + vv + '"');
}
if (req.url.includes("web/web-finder/res/js/virtual_svg-icons-register.publish")) {
// console.log(res.string.match(/return\s*\{\s*width:([\s\S]*?)scalingInfo:([\s\S]*?)\}/))
// res.string = res.string.replace(
// /return\s*{\s*width:(.*?)scalingInfo:(.*?)\s*}/,
// `var mediaInfo = {width:$1scalingInfo:$2};
// console.log("mediaInfo", mediaInfo);
// console.log("this.objectDesc", this.objectDesc);
// return mediaInfo;`
// )
res.string = res.string.replace(/get\s*media\s*\(\)\s*\{/, `
get media(){
if(this.objectDesc){
@@ -231,7 +224,6 @@ export async function startServer({win, upstreamProxy, setProxyErrorCallback = f
type_str: 'm3u8',
}))
break
}
} catch (e) {
log.log(e.toString())

View File

@@ -1,8 +1,8 @@
{
"name": "res-downloader",
"version": "2.0.0",
"version": "2.0.1",
"main": "dist-electron/main/index.js",
"description": "res-downloader(爱享素材下载器)支持视频号、小程序、抖音、快手、小红书、酷狗音乐、qq音乐下载等",
"description": "res-downloader(爱享素材下载器)支持视频号、小程序、抖音、快手、小红书、酷狗音乐、qq音乐、qq短视频等",
"author": "putyy@qq.com",
"license": "MIT",
"private": true,
@@ -50,7 +50,7 @@
"vite-plugin-electron-renderer": "^0.14.5",
"vue": "^3.3.4",
"vue-router": "^4.2.4",
"vue-tsc": "^1.8.8"
"vue-tsc": "^2.0.29"
},
"dependencies": {
"axios": "^1.5.0",

View File

@@ -12,7 +12,10 @@ el-container
Sidebar
el-container
el-main
router-view
router-view(v-slot="{ Component, route }")
keep-alive(v-if="route.meta.keepAlive")
component(:is="Component")
component(v-else :is="Component")
el-footer
Footer
</template>

View File

@@ -13,16 +13,19 @@ const routes = [
{
path: '/index',
name: 'Index',
meta: {keepAlive: true},
component: () => import('./views/Index.vue'),
},
{
path: '/about',
name: 'about',
meta: {keepAlive: true},
component: () => import('./views/About.vue'),
},
{
path: '/setting',
name: 'Setting',
meta: {keepAlive: true},
component: () => import('./views/Setting.vue'),
},
]

View File

@@ -317,10 +317,10 @@ el-container.container
el-main
el-table(ref="multipleTableRef" @selection-change="handleSelectionChange" :data="tableData" max-height="100%" stripe)
el-table-column(type="selection")
el-table-column(label="预览" show-overflow-tooltip width="300px")
el-table-column(label="预览" show-overflow-tooltip width="150px")
template(#default="scope")
div.show_res
video.video(v-if="scope.row.type_str === 'video'" :src="scope.row.url" controls preload="none") 您的浏览器不支持 video 标签
video.video(v-if="scope.row.type_str === 'video'" :src="scope.row.url" controls preload="none")
img.img(v-if="scope.row.type_str === 'image'" :src="scope.row.url" crossorigin="anonymous")
audio.audio(v-if="scope.row.type_str === 'audio'" controls preload="none")
source(:src="scope.row.url" :type="scope.row.type")
@@ -374,12 +374,13 @@ el-container.container
}
.show_res {
width: 100%;
height: auto;
.img {
max-height: 200px;
}
.video {
width: auto;
max-height: 200px;
}
}
.actions {