mirror of
https://github.com/putyy/res-downloader.git
synced 2026-01-13 06:54:56 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca718deaad | ||
|
|
7a01544323 |
@@ -1,9 +1,8 @@
|
||||
# res-downloader
|
||||
#### 爱享素材下载器
|
||||
|
||||
🎯 基于 [electron-vite-vue](https://github.com/electron-vite/electron-vite-vue.git)
|
||||
📦 操作简单、可获取不同类型的资源
|
||||
💪 支持获取视频、音频、图片、m3u8
|
||||
🖥 支持获取视频号、抖音、快手、小红书、酷狗音乐、qq音乐、微信小程序等网络资源
|
||||
💪 支持视频、音频、图片、m3u8等网络资源下载
|
||||
📦 支持微信视频号、小程序、抖音、快手、小红书、酷狗音乐、qq音乐等网络资源下载
|
||||
🍊 支持设置代理以获取特殊网络下的资源
|
||||
|
||||
## 软件下载
|
||||
@@ -23,7 +22,7 @@ yarn install
|
||||
yarn run dev
|
||||
|
||||
# 打包mac
|
||||
yarn run build --mac
|
||||
yarn run build --universal --mac
|
||||
|
||||
# 打包win
|
||||
yarn run build --win
|
||||
|
||||
@@ -15,9 +15,16 @@
|
||||
],
|
||||
"mac": {
|
||||
"icon": "electron/res/icon/icons/mac/icon.icns",
|
||||
"artifactName": "${productName}_${version}.${ext}",
|
||||
"artifactName": "${productName}_${version}.${arch}.${ext}",
|
||||
"singleArchFiles": "*",
|
||||
"target": [
|
||||
"dmg"
|
||||
{
|
||||
"target": "dmg",
|
||||
"arch": [
|
||||
'x64',
|
||||
'arm64'
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"win": {
|
||||
|
||||
@@ -61,27 +61,23 @@ export default function initIPC() {
|
||||
return decodeWxFile(result?.[0], data.decode_key, result?.[0].replace(".mp4", "_解密.mp4"))
|
||||
})
|
||||
|
||||
|
||||
ipcMain.handle('invoke_file_exists', async (event, {save_path, url}) => {
|
||||
let url_sign = hexMD5(url)
|
||||
let res = fs.existsSync(`${save_path}/${url_sign}.mp4`)
|
||||
return {is_file: res, fileName: `${save_path}/${url_sign}.mp4`}
|
||||
ipcMain.handle('invoke_file_exists', async (event, {save_path, url, description}) => {
|
||||
let fileName = description ? description.replace(/[^a-zA-Z\u4e00-\u9fa5]/g, '') : hexMD5(url);
|
||||
let res = fs.existsSync(`${save_path}/${fileName}.mp4`)
|
||||
return {is_file: res, fileName: `${save_path}/${fileName}.mp4`}
|
||||
})
|
||||
|
||||
ipcMain.handle('invoke_down_file', async (event, {index, data, save_path, high}) => {
|
||||
ipcMain.handle('invoke_down_file', async (event, {data, save_path, description}) => {
|
||||
let down_url = data.down_url
|
||||
if (high && data.high_url) {
|
||||
down_url = data.high_url
|
||||
}
|
||||
|
||||
if (!down_url) {
|
||||
return false
|
||||
}
|
||||
|
||||
let url_sign = hexMD5(down_url)
|
||||
let save_path_file = `${save_path}/${url_sign}` + suffix(data.type)
|
||||
let fileName = description ? description.replace(/[^a-zA-Z\u4e00-\u9fa5]/g, '') : hexMD5(down_url);
|
||||
let save_path_file = `${save_path}/${fileName}` + suffix(data.type)
|
||||
if (process.platform === 'win32'){
|
||||
save_path_file = `${save_path}\\${url_sign}` + suffix(data.type)
|
||||
save_path_file = `${save_path}\\${fileName}` + suffix(data.type)
|
||||
}
|
||||
|
||||
if (fs.existsSync(save_path_file)) {
|
||||
@@ -116,8 +112,6 @@ export default function initIPC() {
|
||||
return
|
||||
}
|
||||
|
||||
console.log('url', url)
|
||||
|
||||
previewWin.loadURL(url).then(r => {
|
||||
return
|
||||
}).catch(res => {
|
||||
@@ -143,4 +137,4 @@ export default function initIPC() {
|
||||
export function setWin(w, p) {
|
||||
win = w
|
||||
previewWin = p
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,6 +160,15 @@ export async function startServer({
|
||||
let urlInfo = urlTool.parse(res_url, true)
|
||||
switch (ctype) {
|
||||
case "video/mp4":
|
||||
case "video/webm":
|
||||
case "video/ogg":
|
||||
case "video/x-msvideo":
|
||||
case "video/mpeg":
|
||||
case "video/quicktime":
|
||||
case "video/x-ms-wmv":
|
||||
case "video/x-flv":
|
||||
case "video/3gpp":
|
||||
case "video/x-matroska":
|
||||
if (videoList.hasOwnProperty(url_sign) === false) {
|
||||
videoList[url_sign] = req.fullUrl()
|
||||
let high_url = ''
|
||||
@@ -189,6 +198,11 @@ export async function startServer({
|
||||
case "image/svg+xml":
|
||||
case "image/gif":
|
||||
case "image/avif":
|
||||
case "image/bmp":
|
||||
case "image/tiff":
|
||||
case "image/x-icon":
|
||||
case "image/heic":
|
||||
case "image/vnd.adobe.photoshop":
|
||||
win?.webContents?.send?.('on_get_queue', {
|
||||
url_sign: url_sign,
|
||||
url: res_url,
|
||||
@@ -207,6 +221,18 @@ export async function startServer({
|
||||
})
|
||||
break;
|
||||
case "audio/mpeg":
|
||||
case "audio/wav":
|
||||
case "audio/aiff":
|
||||
case "audio/x-aiff":
|
||||
case "audio/aac":
|
||||
case "audio/ogg":
|
||||
case "audio/flac":
|
||||
case "audio/midi":
|
||||
case "audio/x-midi":
|
||||
case "audio/x-ms-wma":
|
||||
case "audio/opus":
|
||||
case "audio/webm":
|
||||
case "audio/mp4":
|
||||
win?.webContents?.send?.('on_get_queue', {
|
||||
url_sign: url_sign,
|
||||
url: res_url,
|
||||
@@ -225,6 +251,7 @@ export async function startServer({
|
||||
})
|
||||
break;
|
||||
case "application/vnd.apple.mpegurl":
|
||||
case "application/x-mpegURL":
|
||||
win.webContents?.send?.('on_get_queue', {
|
||||
url_sign: url_sign,
|
||||
url: res_url,
|
||||
|
||||
@@ -25,12 +25,6 @@ const safeDOM = {
|
||||
},
|
||||
}
|
||||
|
||||
/**
|
||||
* https://tobiasahlin.com/spinkit
|
||||
* https://connoratherton.com/loaders
|
||||
* https://projects.lukehaas.me/css-loaders
|
||||
* https://matejkustec.github.io/SpinThatShit
|
||||
*/
|
||||
function useLoading() {
|
||||
const className = `loaders-css__square-spin`
|
||||
const styleContent = `
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "res-downloader",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"main": "dist-electron/main/index.js",
|
||||
"description": "Electron + Vue + Vite 实现的资源下载软件,支持微信视频号下载、抖音视频下载、快手视频下载、酷狗音乐下载等",
|
||||
"author": "putyy@qq.com",
|
||||
|
||||
@@ -21,12 +21,7 @@ const jump = (scene: number)=>{
|
||||
break;
|
||||
case 4:
|
||||
ipcRenderer.invoke('invoke_open_default_browser', {
|
||||
url: "https://github.com/putyy/res-downloader/issues"
|
||||
})
|
||||
break;
|
||||
case 5:
|
||||
ipcRenderer.invoke('invoke_open_default_browser', {
|
||||
url: "https://haokawx.lot-ml.com/Product/Index/22550"
|
||||
url: "https://s.gowas.cn/d/4089-quan-ping-tai-zi-yuan-xia-zai-ruan-jian"
|
||||
})
|
||||
break;
|
||||
case 6:
|
||||
@@ -42,11 +37,11 @@ div.line
|
||||
a.item 当前版本: {{v}}
|
||||
a.item 站长邮箱: gowas.work@gmail.com
|
||||
a.item(@click="jump(1)") 获取更新
|
||||
a.item(@click="jump(2)") 云盘资源
|
||||
div.line
|
||||
a.item(@click="jump(3)") 图片无损压缩
|
||||
a.item(@click="jump(4)") 问题反馈
|
||||
a.item(@click="jump(5)") 流量卡推荐
|
||||
div.line
|
||||
a.item 推荐:
|
||||
a.item(@click="jump(2)") 云盘资源
|
||||
a.item(@click="jump(3)") 图片无损压缩
|
||||
a.item(@click="jump(6)") 软件源码
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import {inject, onMounted, ref, watch} from 'vue'
|
||||
import localStorageCache from "../../common/localStorage";
|
||||
import localStorageCache from "../../common/localStorage"
|
||||
|
||||
const appName = "爱享素材"
|
||||
const sidebarCollapse = ref(inject('sidebarCollapse'))
|
||||
|
||||
@@ -3,7 +3,7 @@ import {ref, onMounted, onUnmounted, watch} from "vue"
|
||||
import {ipcRenderer} from 'electron'
|
||||
import {ElMessage, ElLoading, ElTable} from "element-plus"
|
||||
import localStorageCache from "../common/localStorage"
|
||||
import {Delete, Promotion} from "@element-plus/icons-vue";
|
||||
import {Delete, Promotion} from "@element-plus/icons-vue"
|
||||
|
||||
interface resData {
|
||||
url_sign: string,
|
||||
@@ -153,7 +153,7 @@ const handleBatchDown = async () => {
|
||||
}
|
||||
|
||||
|
||||
const handleDown = async (index: number, row: any, high: boolean) => {
|
||||
const handleDown = async (index: number, row: any) => {
|
||||
|
||||
let save_dir = localStorageCache.get("save_dir")
|
||||
|
||||
@@ -173,7 +173,8 @@ const handleDown = async (index: number, row: any, high: boolean) => {
|
||||
|
||||
let result = await ipcRenderer.invoke('invoke_file_exists', {
|
||||
save_path: save_dir,
|
||||
url: (high && row.high_url) ? row.high_url : row.url,
|
||||
url: row.high_url ? row.high_url : row.url,
|
||||
description: row.description
|
||||
})
|
||||
|
||||
if (result.is_file) {
|
||||
@@ -189,10 +190,9 @@ const handleDown = async (index: number, row: any, high: boolean) => {
|
||||
}
|
||||
|
||||
ipcRenderer.invoke('invoke_down_file', {
|
||||
index: index,
|
||||
data: Object.assign({}, tableData.value[index]),
|
||||
save_path: save_dir,
|
||||
high: high
|
||||
description: row.description
|
||||
}).then((res) => {
|
||||
if (res !== false) {
|
||||
tableData.value[index].progress_bar = "100%"
|
||||
@@ -336,7 +336,7 @@ el-container.container
|
||||
template(#default="scope")
|
||||
div.actions
|
||||
template(v-if="scope.row.type_str !== 'm3u8'" )
|
||||
el-button(v-if="!scope.row.save_path" link type="primary" @click="handleDown(scope.$index, scope.row, false)") {{scope.row.decode_key ? "解密下载(视频号)" : "下载"}}
|
||||
el-button(v-if="!scope.row.save_path" link type="primary" @click="handleDown(scope.$index, scope.row)") {{scope.row.decode_key ? "解密下载(视频号)" : "下载"}}
|
||||
el-button(v-if="scope.row.decode_key" link type="primary" @click="decodeWxFile(scope.$index)") 视频解密(视频号)
|
||||
el-button(link type="primary" @click="handlePreview(scope.$index, scope.row)") 窗口预览
|
||||
el-button(link type="primary" @click="handleCopy(scope.row.down_url)") 复制链接
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import {onMounted, ref} from "vue";
|
||||
import {ipcRenderer} from "electron";
|
||||
import localStorageCache from "../common/localStorage";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {onMounted, ref} from "vue"
|
||||
import {ipcRenderer} from "electron"
|
||||
import localStorageCache from "../common/localStorage"
|
||||
import {ElMessage} from "element-plus"
|
||||
|
||||
const saveDir = ref("")
|
||||
const upstream_proxy = ref("")
|
||||
@@ -43,4 +43,4 @@ el-form
|
||||
el-input(v-model="upstream_proxy" placeholder="例如: http://127.0.0.1:7890 修改此项需重启本软件" )
|
||||
el-form-item
|
||||
el-button(type="primary" @click="onSetting") 保存
|
||||
</template>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user