From 6d4e6ef214b8694a09ab6ff5f143d59adab9b6a1 Mon Sep 17 00:00:00 2001 From: alger Date: Sun, 18 May 2025 10:57:19 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E2=9C=A8=20feat:=20=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84Content-Security-Policy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/src/renderer/index.html b/src/renderer/index.html index fccb365..b6fbd31 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -7,7 +7,6 @@ name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> - 网抑云音乐 | AlgerKong | AlgerMusicPlayer From e9fe9000f6c1353193d8b87b909a1f8aeeffe179 Mon Sep 17 00:00:00 2001 From: alger Date: Sun, 18 May 2025 12:42:15 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=90=9E=20fix(player):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=92=AD=E6=94=BE=E7=8A=B6=E6=80=81=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复在播放相同ID但不同URL的音乐时,播放状态判断逻辑错误的问题。现在只有当音乐ID和URL都相同时才会切换播放/暂停状态。 --- src/renderer/store/modules/player.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/store/modules/player.ts b/src/renderer/store/modules/player.ts index 7e51df1..7994031 100644 --- a/src/renderer/store/modules/player.ts +++ b/src/renderer/store/modules/player.ts @@ -119,6 +119,7 @@ export const getSongUrl = async ( // 如果自定义音源解析失败,继续使用正常的获取流程 console.warn('自定义音源解析失败,使用默认音源'); } catch (error) { + console.error('error',error) console.error('自定义音源解析出错:', error); } } @@ -548,7 +549,7 @@ export const usePlayerStore = defineStore('player', () => { const setPlay = async (song: SongResult) => { try { // 如果是当前正在播放的音乐,则切换播放/暂停状态 - if (playMusic.value.id === song.id) { + if (playMusic.value.id === song.id && playMusic.value.playMusicUrl === song.playMusicUrl) { if (play.value) { setPlayMusic(false); audioService.getCurrentSound()?.pause(); From f68f49973a443f9e502859970f3f93a5d46de673 Mon Sep 17 00:00:00 2001 From: alger Date: Sun, 18 May 2025 12:43:09 +0800 Subject: [PATCH 3/7] =?UTF-8?q?perf(=E8=AF=B7=E6=B1=82):=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=AF=B7=E6=B1=82=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=87=B315000=E6=AF=AB=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/utils/request.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/utils/request.ts b/src/renderer/utils/request.ts index 7b3508f..da70352 100644 --- a/src/renderer/utils/request.ts +++ b/src/renderer/utils/request.ts @@ -17,7 +17,7 @@ const baseURL = window.electron const request = axios.create({ baseURL, - timeout: 5000, + timeout: 15000, withCredentials: true }); From 54cbb84e6e836446a853f16abf2072bffb212896 Mon Sep 17 00:00:00 2001 From: alger Date: Sun, 18 May 2025 12:43:27 +0800 Subject: [PATCH 4/7] =?UTF-8?q?style(player):=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E9=9F=B3=E6=BA=90=E9=80=89=E9=A1=B9=E7=9A=84=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/components/player/ReparsePopover.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/player/ReparsePopover.vue b/src/renderer/components/player/ReparsePopover.vue index 84a6b28..05e078b 100644 --- a/src/renderer/components/player/ReparsePopover.vue +++ b/src/renderer/components/player/ReparsePopover.vue @@ -84,12 +84,12 @@ const isReparse = computed(() => { // 可选音源列表 const musicSourceOptions = ref([ - { label: 'MiGu音乐', value: 'migu' as Platform }, - { label: '酷狗音乐', value: 'kugou' as Platform }, + { label: 'MiGu', value: 'migu' as Platform }, + { label: 'KuGou', value: 'kugou' as Platform }, { label: 'pyncmd', value: 'pyncmd' as Platform }, - { label: '酷我音乐', value: 'kuwo' as Platform }, - { label: 'Bilibili音乐', value: 'bilibili' as Platform }, - { label: 'GD音乐台', value: 'gdmusic' as Platform } + { label: 'KuWo', value: 'kuwo' as Platform }, + { label: 'Bilibili', value: 'bilibili' as Platform }, + { label: 'GdMuisc', value: 'gdmusic' as Platform } ]); // 检查音源是否被选中 From e47c84e5eb3c1dcfe8f10e21d565b488c382e364 Mon Sep 17 00:00:00 2001 From: alger Date: Sun, 18 May 2025 12:44:23 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E2=9C=A8=20feat:=E4=BC=98=E5=8C=96B?= =?UTF-8?q?=E7=AB=99=E9=9F=B3=E9=A2=91=E8=A7=A3=E6=9E=90=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/api/bilibili.ts | 29 +++++++++++++++++++++++++++++ src/renderer/api/gdmusic.ts | 20 -------------------- src/renderer/api/music.ts | 30 ++++++++++++++++++++++++------ 3 files changed, 53 insertions(+), 26 deletions(-) diff --git a/src/renderer/api/bilibili.ts b/src/renderer/api/bilibili.ts index 0998846..90fb550 100644 --- a/src/renderer/api/bilibili.ts +++ b/src/renderer/api/bilibili.ts @@ -152,3 +152,32 @@ export const getBilibiliAudioUrl = async (bvid: string, cid: number): Promise => { + try { + // 搜索B站视频,取第一页第一个结果 + const res = await searchBilibili({ keyword, page: 1, pagesize: 1 }); + const result = res.data?.data?.result; + if (!result || result.length === 0) { + throw new Error('未找到相关B站视频'); + } + const first = result[0]; + const bvid = first.bvid; + // 需要获取视频详情以获得cid + const detailRes = await getBilibiliVideoDetail(bvid); + const pages = detailRes.data.pages; + if (!pages || pages.length === 0) { + throw new Error('未找到视频分P信息'); + } + const cid = pages[0].cid; + // 获取音频URL + return await getBilibiliAudioUrl(bvid, cid); + } catch (error) { + console.error('根据名称搜索B站音频URL失败:', error); + throw error; + } +} \ No newline at end of file diff --git a/src/renderer/api/gdmusic.ts b/src/renderer/api/gdmusic.ts index 593c908..b2e232b 100644 --- a/src/renderer/api/gdmusic.ts +++ b/src/renderer/api/gdmusic.ts @@ -126,26 +126,6 @@ export const parseFromGDMusic = async ( } }; -/** - * 获取音质映射 - * @param qualitySetting 设置中的音质选项 - * @returns 映射到GD音乐台的音质参数 - */ -export const getQualityMapping = (qualitySetting: string): string => { - const qualityMap: Record = { - standard: '128', - higher: '320', - exhigh: '320', - lossless: '740', - hires: '999', - jyeffect: '999', - sky: '999', - dolby: '999', - jymaster: '999' - }; - return qualityMap[qualitySetting] || '320'; -}; - interface GDMusicUrlResult { url: string; br: string; diff --git a/src/renderer/api/music.ts b/src/renderer/api/music.ts index a8f5473..127f13f 100644 --- a/src/renderer/api/music.ts +++ b/src/renderer/api/music.ts @@ -5,7 +5,9 @@ import { isElectron } from '@/utils'; import request from '@/utils/request'; import requestMusic from '@/utils/request_music'; import { cloneDeep } from 'lodash'; -import { parseFromGDMusic, getQualityMapping } from './gdmusic'; +import { parseFromGDMusic } from './gdmusic'; +import type { SongResult } from '@/type/music'; +import { searchAndGetBilibiliAudioUrl } from './bilibili'; const { addData, getData, deleteData } = musicDB; @@ -80,7 +82,7 @@ export const getMusicLrc = async (id: number) => { } }; -export const getParsingMusicUrl = async (id: number, data: any) => { +export const getParsingMusicUrl = async (id: number, data: SongResult) => { const settingStore = useSettingsStore(); // 如果禁用了音乐解析功能,则直接返回空结果 @@ -98,7 +100,25 @@ export const getParsingMusicUrl = async (id: number, data: any) => { try { enabledSources = JSON.parse(savedSource); console.log(`使用歌曲 ${id} 自定义音源:`, enabledSources); + if(enabledSources.includes('bilibili')){ + // 构建搜索关键词,依次判断歌曲名称、歌手名称和专辑名称是否存在 + const songName = data?.name || ''; + const artistName = Array.isArray(data?.ar) && data.ar.length > 0 && data.ar[0]?.name ? data.ar[0].name : ''; + const albumName = data?.al && typeof data.al === 'object' && data.al?.name ? data.al.name : ''; + const name = [songName, artistName, albumName].filter(Boolean).join(' ').trim(); + console.log('开始搜索bilibili音频', name); + return { + data: { + code: 200, + message: 'success', + data: { + url: await searchAndGetBilibiliAudioUrl(name) + } + } + } + } } catch (e) { + console.error('e',e) console.error('解析自定义音源失败, 使用全局设置', e); enabledSources = settingStore.setData.enabledMusicSources || []; } @@ -108,13 +128,11 @@ export const getParsingMusicUrl = async (id: number, data: any) => { } // 检查是否选择了GD音乐台解析 + if (enabledSources.includes('gdmusic')) { // 获取音质设置并转换为GD音乐台格式 try { - const quality = getQualityMapping(settingStore.setData.musicQuality || 'higher'); - - // 调用封装的GD音乐台解析服务 - const gdResult = await parseFromGDMusic(id, data, quality); + const gdResult = await parseFromGDMusic(id, data, '999'); if (gdResult) { return gdResult; } From 01a3a7a5011fa4889e4eddaeca0b686c7544bccb Mon Sep 17 00:00:00 2001 From: alger Date: Sun, 18 May 2025 12:45:19 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E2=9C=A8=20feat:=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=9F=B3=E4=B9=90=E5=B9=B3=E5=8F=B0=E9=93=BE=E6=8E=A5=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/lang/zh-CN/settings.ts | 2 +- src/renderer/components/Coffee.vue | 2 +- .../components/common/DonationList.vue | 27 +++---- src/renderer/layout/components/SearchBar.vue | 2 +- src/renderer/views/set/index.vue | 80 ++++++++++++------- 5 files changed, 66 insertions(+), 47 deletions(-) diff --git a/src/i18n/lang/zh-CN/settings.ts b/src/i18n/lang/zh-CN/settings.ts index 72a3e57..6731ab9 100644 --- a/src/i18n/lang/zh-CN/settings.ts +++ b/src/i18n/lang/zh-CN/settings.ts @@ -44,7 +44,7 @@ export default { }, playback: { quality: '音质设置', - qualityDesc: '选择音乐播放音质(VIP)', + qualityDesc: '选择音乐播放音质(网易云VIP)', qualityOptions: { standard: '标准', higher: '较高', diff --git a/src/renderer/components/Coffee.vue b/src/renderer/components/Coffee.vue index b0680f4..9e0463b 100644 --- a/src/renderer/components/Coffee.vue +++ b/src/renderer/components/Coffee.vue @@ -76,7 +76,7 @@ const copyQQ = () => { }; const toDonateList = () => { - window.open('http://donate.alger.fun', '_blank'); + window.open('http://donate.alger.fun/download', '_blank'); }; defineProps({ diff --git a/src/renderer/components/common/DonationList.vue b/src/renderer/components/common/DonationList.vue index 5956181..6fff1bd 100644 --- a/src/renderer/components/common/DonationList.vue +++ b/src/renderer/components/common/DonationList.vue @@ -4,6 +4,12 @@

{{ t('donation.description') }}

{{ t('donation.message') }}

+ + + {{ t('donation.toDonateList') }} +
@@ -16,15 +22,6 @@ {{ t('common.alipay') }}
- -
{{ donor.name }}
-
¥{{ donor.amount }}
+
{{ donor.date }}
@@ -172,7 +169,7 @@ const toggleExpand = () => { }; const toDonateList = () => { - window.open('http://donate.alger.fun', '_blank'); + window.open('http://donate.alger.fun/download', '_blank'); }; @@ -211,13 +208,9 @@ const toDonateList = () => { @apply rounded-lg p-2.5 transition-all duration-200 hover:shadow-md; @apply bg-light-100 dark:bg-gray-800/5 backdrop-blur-sm; @apply border border-gray-200 dark:border-gray-700/10; - @apply flex flex-col justify-between; + @apply flex flex-col; min-height: 100px; - &.no-message { - @apply justify-between; - } - .card-content { @apply flex items-start gap-2 mb-2; } @@ -327,7 +320,7 @@ const toDonateList = () => { } .qrcode-grid { - @apply flex justify-between items-center gap-4; + @apply flex justify-between items-center gap-4 flex-wrap; .qrcode-item { @apply flex flex-col items-center gap-2; diff --git a/src/renderer/layout/components/SearchBar.vue b/src/renderer/layout/components/SearchBar.vue index 57259be..d1b0e43 100644 --- a/src/renderer/layout/components/SearchBar.vue +++ b/src/renderer/layout/components/SearchBar.vue @@ -266,7 +266,7 @@ const selectItem = async (key: string) => { }; const toGithub = () => { - window.open('http://donate.alger.fun', '_blank'); + window.open('http://donate.alger.fun/download', '_blank'); }; const updateInfo = ref({ diff --git a/src/renderer/views/set/index.vue b/src/renderer/views/set/index.vue index 7850f64..bac84a5 100644 --- a/src/renderer/views/set/index.vue +++ b/src/renderer/views/set/index.vue @@ -40,7 +40,7 @@
-
+
{{ t('settings.basic.font') }}
{{ t('settings.basic.fontDesc') }}
@@ -103,9 +103,9 @@
- {{ setData.animationSpeed }}x -
- {{ setData.animationSpeed }}x +
+ +
@@ -128,28 +140,42 @@
{{ t('settings.sections.playback') }}
-
-
-
{{ t('settings.playback.quality') }}
-
{{ t('settings.playback.qualityDesc') }}
+
+
+
+
{{ t('settings.playback.quality') }}
+
+ {{ t('settings.playback.qualityDesc') }} +
+
+ +
+ +
+
大家还是需要支持正版,本软件只做开源探讨
+
各大音乐会员购买链接
+
-
-
{{ t('settings.playback.musicSources') }}
@@ -418,7 +444,7 @@
-
{{ t('settings.sections.donation') }}
+
{{ t('settings.sectio ns.donation') }}
@@ -499,7 +525,7 @@ import config from '../../../../package.json'; // 所有平台默认值 const ALL_PLATFORMS: Platform[] = ['migu', 'kugou', 'pyncmd', 'bilibili', 'kuwo']; -const platform = window.electron.ipcRenderer.sendSync('get-platform'); +const platform = window.electron ? window.electron.ipcRenderer.sendSync('get-platform') : 'web'; const settingsStore = useSettingsStore(); const userStore = useUserStore(); From a21521cc6f1b904f0c0ee20dcc1425df07f42fcd Mon Sep 17 00:00:00 2001 From: alger Date: Sun, 18 May 2025 13:09:49 +0800 Subject: [PATCH 7/7] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- src/renderer/utils/update.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 221f09b..4fc261d 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ 一个第三方音乐播放器、本地服务、桌面歌词、音乐下载、最高音质 ## 预览地址 -[http://mc.alger.fun/](http://mc.alger.fun/) +[http://music.alger.fun/](http://music.alger.fun/) ## 软件截图 ![首页白](./docs/image.png) diff --git a/src/renderer/utils/update.ts b/src/renderer/utils/update.ts index f7c197a..1292244 100644 --- a/src/renderer/utils/update.ts +++ b/src/renderer/utils/update.ts @@ -135,7 +135,7 @@ export const getLatestReleaseInfo = async (): Promise 'https://api.github.com/repos/algerkong/AlgerMusicPlayer/releases/latest', // 使用代理节点 - 'https://mc.alger.fun/package.json', + 'https://music.alger.fun/package.json', ]; if (token) {