[Feature]: 通过Scheme URL唤起程序并进行搜索

This issue has been created since 2022-02-15.

lxmusic://search="突然的自我 - 伍佰"

好像不起作用,提示如下:
image

说明文档:https://github.com/lyswhut/lx-music-desktop/blob/master/FAQ.md#%E5%90%AF%E5%8A%A8%E5%8F%82%E6%95%B0

请问大佬正确的写法是什么呢?感谢!

lyswhut wrote this answer on 2022-02-15

目前Scheme URL只支持:

  • songlist/open 打开歌单
  • songlist/play 播放歌单
  • music/play 播放歌曲

启动参数调用与Scheme URL调用是不同的两个东西,目前还不支持使用Scheme URL的方式进行搜索,但可以在下个版本添加它

mining-id wrote this answer on 2022-02-15

@lyswhut 哦,感谢大佬回复!
期待可以支持,这样就可以用alfred这种软件快速唤起并搜索了😄

lyswhut wrote this answer on 2022-02-15

下个版本与Scheme URL相关的更改:

  • 新增Scheme URL对音乐搜索的调用支持
  • 新增Scheme URL以url传参的方式调用

文档说明:

Scheme URL支持

从v1.17.0起支持 Scheme URL,可以使用此功能从浏览器等场景下调用LX Music,我们开发了一个油猴脚本配套使用

脚本安装地址:https://greasyfork.org/zh-CN/scripts/438148

以下是目前可用的Scheme URL调用方式:

  • URL统一以lxmusic://开头
  • 此技术目前只支持 Windows、Mac系统
  • 若无特别说明,源的可用值为:kw/kg/tx/wy/mg
  • 若无特别说明,音质的可用值为:128k/320k/flac/flac32bit

目前支持两种传参方式:

  • 通过data传参,以经过URL编码的JSON数据传参,例:lxmusic://music/play?data=xxxx,其中xxxx为经过URL编码后的JSON数据,支持复杂的参数调用
  • 通过URL传参,适用于简单传参的调用,不需要转成JSON格式,例:lxmusic://music/search/xxxx,但仍然需要对数据进行URL编码,只适应于简单参数调用(v1.18.0新增)

data方式传参

以经过URL编码的JSON数据传参,例:lxmusic://music/play?data=xxxx,其中xxxx为经过URL编码后的JSON数据,JSON数据内容取决于下表的参数部分

描述 URL 参数
打开歌单 songlist/open source<String>(源,必须)
id<String/Number>(歌单ID,可选)
url<String>(歌单URL,可选)其中ID与URL必需传一个
播放歌单 songlist/play source<String>(源,必须)
id<String/Number>(歌单ID,可选)
url<String>(歌单URL,可选)其中idurl必需传一个
index<Number>(播放第几首歌,可选,从0开始)
搜索歌曲 music/search keywords<String/Number>(要搜索的内容,必须)
source<String>(源,可选)
播放歌曲 music/play name<String>(歌曲名,必传)
singer<String>(艺术家名,必传)
source<String>(源,必传)
songmid<String/Number>(歌曲ID,必传)
img<String>(歌曲图片链接,选传)
albumId<String/Number>(歌曲专辑ID,选传)
interval<String>(格式化后的歌曲时长,选传,例:03:55
albumName<String>(歌曲专辑名称,选传)
types<Object>(歌曲可用音质数组,必传,
数组格式:[{"type": "<音质>", size: "<格式化后的文件大小,选传>", hash: "<kg源必传>"}]
例:[{"type": "128k", size: "3.56M"}, {"type": "320k", size: null}]

以下为平台特定参数:
hash<String>(歌曲hash,kg源必传)
strMediaMid<String>(歌曲strMediaMid,tx源必传)
albumMid<String>(歌曲albumMid,tx源专用,选传)
copyrightId<String>(歌曲copyrightId,mg源必传)
lrcUrl<String>(歌曲lrcUrl,mg源专用,选传)

URL方式传参

由于URL传参只适用于简单传参场景,所以目前只支持以下功能的调用:

描述 URL 参数
搜索歌曲 music/search/{source}/{keywords} source(源,可选)
keywords(要搜索的内容,必须)
例:music/search/kw/xxxmusic/search/xxx
打开歌单 songlist/open/{source}/{id/url} source(源,必须)
id/url(歌单ID或歌单URL,必须)
例:songlist/open/kw/123456
More Details About Repo
Owner Name lyswhut
Repo Name lx-music-desktop
Full Name lyswhut/lx-music-desktop
Language JavaScript
Created Date 2019-08-14
Updated Date 2022-08-09
Star Count 19877
Watcher Count 290
Fork Count 3580
Issue Count 142

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Extremely long morphball shadow 0 2021-06-26 2022-05-09
ApplicationSet controller spawns too many git zombie processes 0 2022-01-07 2022-08-12
Inline headers give wrong results if compiled without `-O3` 0 2021-11-23 2022-07-24
Move `npm publish` to the `release` command 0 2021-12-31 2022-08-05
Create a comment on affected PRs and issues 0 2021-12-31 2022-08-05
Can't get Video Stream over network (public domain) 5 2021-04-29 2022-07-26
[New Feature] Taste dive suggestions 1 2022-04-21 2022-08-10
Expose a project's package.json data to the application 0 2021-12-16 2022-07-28
launcherOpenImg not able to set height by css 2 2022-03-29 2022-07-22
reports.ipynb: draw_score_stripplot(): isna is not defined for MultiIndex 3 2022-06-07 2022-07-31
Old dependencies problematic for M1 mac 0 2022-07-14 2022-08-10
proxies页面节点前国家emoji不显示 4 2022-03-21 2022-08-10
NetAdapterBinding: Use of State & CurrentState Properties is non-idiomatic 6 2021-02-12 2022-04-12
Resource parameter naming inconsistent 1 2021-05-20 2022-04-12
Add CodeCov Validation Support 0 2020-02-13 2022-04-12
Rename master branch to main 0 2020-08-06 2022-04-12
Enable Code Coverage Reporting 0 2021-04-09 2022-04-12
DnsServerAddress: improve dhcp checks 1 2021-01-20 2022-04-12
Update Sampler Build Tasks 0 2021-04-09 2022-04-12
Description of response property with custom type not being displayed 2 2021-08-06 2022-07-12
Split flutter-webrtc pacakge to interface/native/web 2 2021-09-21 2022-08-07
Page.setDownloadBehaviour deprecated 4 2021-04-16 2022-08-11
Issues when creating runners in vcluster 1 2022-07-11 2022-08-09
Docker caching is gone when cancelling CI 7 2022-07-11 2022-08-09
[Broken Website] Replace with title 0 2022-05-17 2022-08-08
citationStyleLanguage: Check for existence of data (e.g. abstract, author names) 1 2022-01-16 2022-07-24
How to log in through metamask like opensea? 2 2022-01-10 2022-08-11
HEIC files identified as AVIF 7 2022-05-17 2022-08-13
Reconcilation error when pushing to different branch 2 2021-03-26 2022-08-12
Master password to be replaced by main password? 0 2021-04-18 2022-08-03
"Error : Unterminated quoted string" when trying to run turtle setup:android 2 2021-04-13 2022-08-08
TextNote Superscript and Subscript are shifted to the right 2 2021-08-28 2022-08-04
How to show the list element one after one with fade in effect but not using fragment? 1 2021-07-02 2022-07-21
Unity Docs review Basic.md - 3 1 2022-06-13 2022-08-06
The links at Where to next section should open a new tab 6 2021-03-04 2022-07-31
Value cannot be null. Parameter name: Provider error on func start 7 2020-05-21 2022-08-06
Connection does not fully implement ConnectionInterface 9 2021-01-20 2022-08-06
Live Server não abre 4 2021-08-30 2022-03-16
Returning image is blury, When it comes to print image its too badly blury, any solutions 3 2021-09-17 2022-08-09
[Unified Recorder] Should work with the AAD credential 2 2021-11-22 2022-07-31
Add a connector like in tokio-tungestenite 2 2021-03-03 2022-07-28
Are there any chances to turn on cruise on Toyota Prius 2017? 1 2021-04-15 2022-08-11
performance in multik-kotlin 0 2022-07-08 2022-07-31
Azure Database for PostgreSQL is not displayed in Azure Data Studio 0 2022-01-07 2022-01-09
Memory leak due to thousands of leftover hoglins 13 2021-12-01 2022-07-30
Generic way to handle per-project workspace configuration 6 2021-08-18 2022-07-28
runPluginVerifier doesn't resolve latest EAP versions (maybe due to caching) 2 2021-11-28 2022-07-30
[Bug] kyuubi 1.5.0 version ,beeline connection fails in kerberos environment 2 2022-04-01 2022-05-28
Fix typos in the reference documentation 0 2022-06-13 2022-08-03
Maven shade plugin configuration in spring-boot-starter-parent does not append META-INF/spring/*.imports files 0 2022-06-13 2022-08-03