Skip to content

Lyrics plugin for Synology Audio Station/DS Audio

License

Notifications You must be signed in to change notification settings

tabzhao/Synology-LrcPlugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synology Lrc Plugin

Lyrics plugin for Synology Audio Station/DS Audio.

用于群晖 Audio Station/DS Audio 的歌词插件。

Features

  • Sort the search result according to the similarity of artist and title
  • Have Chinese translation if it's available

特色:

  • 根据艺术家标题的相似程度排序搜索结果
  • 有中文歌词翻译(如果有提供)

Usage(用法)

Download from release. There are two flavors: netease_org.aum is the original flavor, which shows the lyric in original language; netease_trans.aum is the translated flavor that has Chinese translation if it's available.

Go to Audio Station -> Settings -> Lyrics Plugin -> Add to add the aum file in your flavor, then enable by ticking it. Then when you play a song the lyric will be downloaded automatically.

If you feel it's not the best match, in Audio Station you can right click on a song, go to Song Information -> Lyrics -> Search Internet which will give you all the search results. You can pick from the second one in the list.

release 下载。有两种口味:netease_org.aum 是清真原味,仅显示歌词原文,适合学霸; netease_trans.aum 是带中文翻译的口味,大众首选。

Audio Station -> 设置 -> 歌词插件 -> 添加 来加入你喜欢口味的 aum 文件,然后记得打勾开启。当你播放时歌词会自动下载。

如果觉得歌词不够匹配,在 Audio Station 右键单击那首歌,去 歌曲信息 -> 歌词 -> 从网络搜索 获取所有搜索结果。你可以从第二个开始尝试,因为第一个就是自动下载的结果。

TODO (May be)

  • 日文歌词通过Google自动翻译成假名、罗马音

Build

In the proejct's root directory, run the included bash script to generate .aum files required by Audio Station. Both original and translated flavors will be generated.

./build.sh

About development(关于开发)

Do not use echo(不要用echo函数)

If the PHP script has echo() inside, Audio Station will fail to return the result!

卡在这好久,后来才发现有 echo() 的话 Audio Station 不能返回任何结果。第一次搞 PHP,整个插件用了大概一个多星期业余时间。

Determine the best match(计算最佳匹配)

  1. Finds out the title that matches exactly or partially
  2. Finds out the best match artist from all artists. (The song might have multiple artists)
  3. Sort the search result based on the similarity of artist and title using similar_text()

Chinese translation(中文翻译)

Some songs have Chinese translation, the translation is in another lyric file. So this PHP also append the translation to the end of each original lyric line when the time tag matches.

Test web API with curl

Step 1: Use this command to search for a song named Tell Your World, then you can get a JSON response:

curl -v -X POST http://music.163.com/api/search/pc -d "s=Tell Your World&type=1"

Step 2: Find the ID in the previous response with key id, then you can download the file. In this case the ID is 858520. Then you can get a JSON response that contains the lyric.

curl -v -X GET "http://music.163.com/api/song/lyric?os=pc&id=858520&lv=-1&kv=0&tv=-1"

Query parameters in the request: lv = original version; tv = translated version; kv = karaoke version, rarely available. Set value to 0 if you don't want that particular version.

Inspired by(灵感来源)

Synology Lyric project by Frank Lai

PHP API by Moonlib

Synology Audio Station 歌詞外掛 by Raykuo

About

Lyrics plugin for Synology Audio Station/DS Audio

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 95.9%
  • Shell 4.1%