Git Product home page Git Product logo

org.kde.plasma.yesplaymusic-lyrics's Introduction

yesplaymusic-lyric

前言

作为重度网易云用户,YesPlayMusic 大概是我能在linux上找到的最好的播放器了,但是歌词显示一直是个痛点。本人平常主力机是Archlinux,桌面环境是kde,有啥需求当然是直接在aur里面找,但找到的桌面歌词软件都有这样那样的bug,实在不尽人意。 正巧昨日在贴吧刷到了@LiYulin大佬为kde做的插件,是用python后端加上qml前端编写的,于是想着能不能把这后端也去了。于是便产生了这个小项目。解析歌词的部分使用了js-lyrics

原理

YesPlayMusic在运行时会开放两个api获取歌曲信息,一个是http://127.0.0.1:27232/player用来获取基本信息,另一个是http://127.0.0.1:10754/lyric?id=用来获取歌词,两个api的返回值如下:

/* http://127.0.0.1:27232/player */:

{
    "currentTrack": {
    "name": "broKen NIGHT",
    "id": 476081900,
    "pst": 0,
    "t": 0,
    "ar": [{
        "id": 16152,
        "name": "Aimer",
        "tns": [],
        "alias": []
    }],
    "alia": ["PS Vitaゲーム「Fate/hollow ataraxia」OPテーマ"],
    "pop": 40,
    ......
    "progress":61.662793
}

/* http://127.0.0.1:10754/lyric?id=476081900 */:

{
     "sgc": false,
     "sfy": false,
     "qfy": false,
     "transUser": {
         "id": 2090794,
         "status": 99,
         "demand": 1,
         "userid": 59957287,
         "nickname": "虎纹鲨鱼子",
         "uptime": 1493869287084
     },
     "lyricUser": {
         "id": 2090785,
         "status": 99,
         "demand": 0,
         "userid": 59957287,
         "nickname": "虎纹鲨鱼子",
         "uptime": 1493869287084
     },
     "lrc": {
         "version": 16,
         "lyric": "[00:19.83]流れる星(ひかり)を\n[00:18.62]\n[00:26.19]ただ 重ねる指を\n"
     },
     "klyric": {
         "version": 0,
         "lyric": ""
     },
     "tlyric": {
         "version": 7,
         "lyric": "[by:虎纹鲨鱼子]\n[00:11.13]\n[00:19.83]向着流星祈愿\n[00:26.19]看,只要双手合十\n"
     },
     "romalrc": {
         "version": 4,
         "lyric": "[by:虎纹鲨鱼子]\n[00:11.13]\n[00:19.83]na ga re ru ho shi wo\n[00:26.19]ta da ka sa ne ru yu bi wo\n"
     },
     "code": 200
 }

安装

git clone https://github.com/zsiothsu/org.kde.plasma.yesplaymusic-lyrics
cp -r org.kde.plasma.yesplaymusic-lyrics ~/.local/share/plasma/plasmoids/org.kde.plasma.yesplaymusic-lyrics

org.kde.plasma.yesplaymusic-lyrics's People

Contributors

zsiothsu avatar izumisagirii avatar

Stargazers

企鹅2035 avatar  avatar  avatar  avatar  avatar cmach_socket avatar XiaoTian avatar

Watchers

 avatar

org.kde.plasma.yesplaymusic-lyrics's Issues

希望加上同时显示歌词原文和译文的选项

首先感谢大佬的付出,让我在更新KDE6后还能继续用上歌词显示插件。

但我有个不情之请:@liyulin大佬的插件支持 原文+译文 同时显示,我转过来后有点不习惯。

不是什么刚需,但如果大佬能采纳,那么感激不尽

转义字符兼容问题

似乎歌词中的转义字符不会被正确翻译,例如 "
以下为插件中显示的歌词
1
以下为yesplaymusic中显示的原始歌词
2

关于歌词api超时导致卡死的反馈

arch+kde

xhr.open('GET', 'http://127.0.0.1:10754/lyric?id=' + tracker.id, true)这里会卡若干分钟之后返回502,貌似在此期间程序会循环GET请求导致plasmashell崩溃

出于强迫症看了ypm的repo,但是没有定位到歌词api出错的原理,yesplaymusic一直是一年前的版本,字幕没有出错

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.