Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: 通过 URL 参数指定音频地址/歌词文本 #45

Open
Yesterday17 opened this issue Nov 30, 2021 · 1 comment
Open

Comments

@Yesterday17
Copy link

希望可以通过诸如 ?url=http://example.com/test.mp3&lyric=yyy 的方式(需 URL 编码)快速填入音频地址,这样能够更方便与外部集成。

使用场景:

  • Tampermonkey 脚本自动从音乐网站跳转,自动填入音乐地址;通过歌词源自动获取歌词文本
@magic-akari
Copy link
Owner

目前载入音频是支持的。

const url = searchParams.get("url");
if (url !== null) {
return url;
}
const text = searchParams.get("text") || searchParams.get("title") || "";
const result = /https?:\/\/\S+/.exec(text);
src = result && nec(result[0]);

参数是 url。
后边的 text 和 title 虽然也能用,但是是为了配合 PWA 的 share target 用的。

目前是 undocumented API,因为我也不确定这种形式是不是最好的。

载入歌词目前没有。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants