Giter Site home page Giter Site logo

musicbox's Introduction

NetEase-MusicBox

感谢为 MusicBox 的开发付出过努力的每一个人

高品质网易云音乐命令行版本,简洁优雅,丝般顺滑,基于 Python 编写。

Software License versions PyPI - Python Version

Demo

NetEase-MusicBox-GIF

功能特性

  1. 320kbps 的高品质音乐
  2. 歌曲,艺术家,专辑检索
  3. 网易 22 个歌曲排行榜
  4. 网易新碟推荐
  5. 网易精选歌单
  6. 网易主播电台
  7. 私人歌单,每日推荐
  8. 随心打碟
  9. 本地收藏,随时加 ❤
  10. 播放进度及播放模式显示
  11. 现在播放及桌面歌词显示
  12. 歌曲评论显示
  13. 一键进入歌曲专辑
  14. 定时退出
  15. Vimer 式快捷键让操作丝般顺滑
  16. 可使用数字快捷键
  17. 可使用自定义全局快捷键
  18. 对当前歌单列表进行本地模糊搜索

键盘快捷键

有 num + 字样的快捷键可以用数字修饰,按键顺序为先输入数字再键入被修饰的键,即 num + 后的快捷键。

Key Effect
j Down 下移
k Up 上移
num + j Quick Jump 快速向后跳转 n 首
num + k Quick Up 快速向前跳转 n 首
h Back 后退
l Forword 前进
u Prev Page 上一页
d Next Page 下一页
f Search 当前列表模糊搜索
[ Prev Song 上一曲
] Next Song 下一曲
num + [ Quick Prev Song 快速前 n 首
num + ] Quick Next Song 快速后 n 首
num + Shift + g Index for Song 跳到第 n 首
= Volume + 音量增加
- Volume - 音量减少
Space Play/Pause 播放/暂停
? Shuffle 手气不错
m Menu 主菜单
p Present/History 当前/历史播放列表
i Music Info 当前音乐信息
Shift + p Playing Mode 播放模式切换
a Add 添加曲目到打碟
Shift + a Enter Album 进入专辑
g To the First 跳至首项
Shift + g To the End 跳至尾项
z DJ List 打碟列表
s Star 添加到收藏
c Collection 收藏列表
r Remove 删除当前条目
Shift + j Move Down 向下移动当前项目
Shift + k Move Up 向上移动当前项目
Shift + c Cache 缓存歌曲到本地
, Like 喜爱
. Trash FM 删除 FM
/ Next FM 下一 FM
q Quit 退出
t Timing Exit 定时退出
w Quit & Clear 退出并清除用户信息

安装

必选依赖

  1. mpg123 用于播放歌曲,安装方法参见下面的说明
  2. python-fuzzywuzzy 用于模糊搜索

可选依赖

  1. aria2 用于缓存歌曲
  2. libnotify-bin 用于支持消息提示(Linux 平台)
  3. qtpy python-dbus dbus qt 用于支持桌面歌词 (根据系统 qt 的版本还需要安装 pyqt4 pyqt4 pyside pyside2 中的任意一个)
  4. python-levenshtein 用于模糊搜索

PyPi 安装(*nix 系统)

    pip3 install NetEase-MusicBox

Git clone 安装 master 分支(*nix 系统)

    git clone https://github.com/darknessomi/musicbox.git && cd musicbox
    poetry build && poetry install

macOS 安装

    pip3 install NetEase-MusicBox
    brew install mpg123

Linux 安装

注意:通过以下方法安装可能仍然需要pip3 install -U NetEase-MusicBox更新到最新版

Fedora

首先添加FZUG源,然后sudo dnf install musicbox

Ubuntu/Debian

    pip3 install NetEase-MusicBox
    sudo apt-get install mpg123

Arch Linux

    pacaur -S netease-musicbox-git # or $ yaourt musicbox

Centos/Red Hat

    sudo yum install -y python3-devel
    pip3 install NetEase-MusicBox
    wget http://mirror.centos.org/centos/7/os/x86_64/Packages/mpg123-1.25.6-1.el7.x86_64.rpm
    sudo yum install -y mpg123-1.25.6-1.el7.x86_64.rpm

配置和错误处理

配置文件地址: ~/.config/netease-musicbox/config.json 可配置缓存,快捷键,消息,桌面歌词。 由于歌曲 API 只接受**大陆地区访问,非**大陆地区用户请自行设置代理(可用 polipo 将 socks5 代理转换成 http 代理):

export http_proxy=http://IP:PORT
export https_proxy=http://IP:PORT
curl -L ip.cn

显示 IP 属于**大陆地区即可。

已测试的系统兼容列表

OS Version
Arch Rolling
macOS 10.15.7

错误处理

当某些歌曲不能播放时,总时长为 00:01 时,请检查是否为版权问题导致。

如遇到在特定终端下不能播放问题,首先检查此终端下 mpg123 能否正常使用,其次检查其他终端下 musicbox 能否正常使用,报告 issue 的时候请告知以上使用情况以及出问题终端的报错信息。

同时,您可以通过tail -f ~/.local/share/netease-musicbox/musicbox.log自行查看日志。 mpg123 最新的版本可能会报找不到声音硬件的错误,测试了 1.25.6 版本可以正常使用。

已知问题及解决方案

  • #374 i3wm 下播放杂音或快进问题,此问题常见于 Arch Linux。尝试更改 mpg123 配置。
  • #405 32 位 Python 下 cookie 时间戳超出了 32 位整数最大值。尝试使用 64 位版本的 Python 或者拷贝 cookie 文件到对应位置。
  • #347 暂停时间超过一定长度(数分钟)之后 mpg123 停止输出,导致切换到下一首歌。此问题是 mpg123 的 bug,暂时无解决方案。
  • #791 版权问题,master 分支已经修复

使用

    musicbox

Enjoy it !

更新日志

2021-01-18 版本 0.3.1 错误修复

2020-10-23 版本 0.3.0 接口更新,错误修复

2018-11-28 版本 0.2.5.4 修复多处错误

2018-06-21 版本 0.2.5.3 修复多处播放错误

2018-06-07 版本 0.2.5.1 修复配置文件错误

2018-06-05 版本 0.2.5.0 全部迁移到新版 api,大量错误修复

更多>>

LICENSE

MIT

musicbox's People

Contributors

20015jjw avatar 41tair avatar a-mushroom avatar anhoder avatar ayanamimcy avatar caitinggui avatar catofes avatar chaserhkj avatar chen310 avatar chih7 avatar darknessomi avatar diartyz avatar gewentao avatar god2g avatar hbprotoss avatar heimeil avatar kigawas avatar lozzo avatar ma233 avatar miuc avatar nobles5e avatar out0fmemory avatar pkumza avatar po1ng avatar prikevs avatar timothyqiu avatar tonyfettes avatar yaphone avatar zexi avatar zhangwenxuan322 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

musicbox's Issues

Windows的适配

试着在Windows上运行,结果当然不太好。

  • 首先是curses在Windows下的缺失(当然可以通过 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 来解决
  • 其次是窗口指令(因为缺乏了XTerm,所以SIGWINCH作废
  • 然后是窗口输出乱码(老问题了
  • 最后比较不确定的是mpg123这个库的Windows情况(因为没运行起来

建议?:

  • 判断OS,如在Windows系统下则跳过SIGWINCH以及转换为gbk(当然翻译成英文个人也是可以的

因为个人不是学python的所以也无能为力提交pull request :(

增加播放进度条

在界面上给当前正在播放的歌曲增加播放进度条,可以类似wget的下载进度条

新功能建议

为什么不添加一个将歌曲添加到歌单的功能呢?

About build_playinfo

I'm working on the song name scrolling feature. I'm finished with the menu part, where the long song name will scroll automatically. Here' s what it looks like:

scroll_demo

I'm now having trouble applying it to the build_playinfo function: it repeatedly print the whole screen. I'm wondering, how is this function different from build_menu? Thanks in advance.

问题反馈

ubuntu15.04
执行sudo python setup.py install
出错
Traceback (most recent call last):
File "setup.py", line 37, in
from setuptools import setup, find_packages
ImportError: No module named setuptools

there is a problem.i do not know what it is.

M-gM-=~QM-f~X~SM-dM-:~QM-i~_M-3M-dM-9~P



            -> 0. M-f~N~RM-hM-!~LM-fM-&~\
               1. M-h~IM-:M-f~\M-/M-eM-.M-6
               2. M-f~VM-0M-gM-"~_M-dM-8~JM-f~^M-6
               3. M-gM-2M->M-i~@~IM-fM--~LM-e~M~U
               4. M-f~H~QM-g~Z~DM-fM--~LM-e~M~U
               5. DJM-h~J~BM-g~[M-.
               6. M-f~I~SM-gM-"~_
               7. M-f~TM-6M-h~W~O
               8. M-f~P~\M-gM-4M-"
               9. M-eM-8M-.M-e~JM-)

when i run it,this is the first look

网易云盘相关API

网易云音乐客户端提供了一个叫做云盘的东西,可以手工上传曲子,并且播放。不过现在只支持客户端。不知道要不要添加到这个项目里。如图:
2015-03-31 22 20 47
图中的Mirai Miracle 就是手工上传的曲子。这个在网页版的api中得不到相关的信息。

用Anyproxy分析了一下PC端的api,大概有以下的结果:

原来api是
http://music.163.com/api/playlist/detail?id=30391223&offset=0&total=true&limit=1001&csrf_token=358c82d006c539e72c6f68583a95ceb9

测试发现新的api变成了
http://music.163.com/api/v2/playlist/detail?id=30391223&offset=0&total=true&limit=1001&csrf_token=358c82d006c539e72c6f68583a95ceb9

当携带Cookie

[
{
    "domain": ".music.163.com",
    "expirationDate": 1459434720,
    "hostOnly": false,
    "httpOnly": false,
    "name": "MUSIC_U",
    "path": "/",
    "secure": false,
    "session": false,
    "storeId": "0",
    "value": "e2d3b03bfec5a6b3944edc75b89ce65a45c8d4980aa439590d31c0fe4f1b3684abdac0706d3b3a5e0e7d62790d97a47faf9e62a8590fd08a",
    "id": 1
},
{
    "domain": ".music.163.com",
    "expirationDate": 1459434600,
    "hostOnly": false,
    "httpOnly": false,
    "name": "os",
    "path": "/",
    "secure": false,
    "session": false,
    "storeId": "0",
    "value": "pc",
    "id": 2
}
]

的时候即可得到结果。测试得到只有携带os=pc 的cookie就可以返回不含云网盘数据的playlist, 也就是等同于现在的api,不过具体的参数以及定义都有所改变。如果想要得到云网盘的数据,需要携带MUSIC_U参数。这个参数还不知道时怎么得到的。貌似正常网页版登陆后也会有这个参数。

然后返回的数据大概如下,做了json的解析:

{
    "playlist": {
        "subscribers": [],
        "subscribed": false,
        "creator": {
            "signature": "",
            "authority": 0,
            "description": "",
            "userId": 37734080,
            "nickname": "Catofes",
            "avatarUrl": "http://p4.music.126.net/L-1w-AuM_2TH-tW7Olsp3g==/3223768092658904.jpg",
            "backgroundImgId": 2002210674180202,
            "avatarImgId": 3223768092658904,
            "mutual": false,
            "gender": 0,
            "birthday": -2209017600000,
            "province": 110000,
            "city": 110101,
            "defaultAvatar": false,
            "userType": 0,
            "accountStatus": 0,
            "expertTags": null,
            "detailDescription": "",
            "djStatus": 0,
            "authStatus": 0,
            "followed": false,
            "backgroundUrl": "http://p1.music.126.net/pmHS4fcQtcNEGewNb5HRhg==/2002210674180202.jpg"
        },
        "tracks": [
            {
                "rtUrls": [],
                "name": "新鸳鸯蝴蝶梦",
                "id": 95410,
                "v": 3,
                "st": 1,
                "t": 0,
                "fee": 0,
                "ftype": 0,
                "rtype": 0,
                "rurl": null,
                "no": 1,
                "pst": 0,
                "alia": [],
                "pop": 90,
                "rt": "",
                "mst": 9,
                "cp": 5003,
                "crbt": "835fbd444d38c4f4e1efe33c11bf3954",
                "mv": 0,
                "cf": "",
                "ar": [
                    {
                        "id": 3082,
                        "name": "黄安"
                    }
                ],
                "al": {
                    "id": 9319,
                    "name": "新鸳鸯蝴蝶梦",
                    "picStr": "38482906984192",
                    "pic": 38482906984192
                },
                "dt": 261799,
                "h": {
                    "br": 320000,
                    "fid": 1031341906860656,
                    "size": 10485884,
                    "vd": -0.000265076
                },
                "m": {
                    "br": 160000,
                    "fid": 1020346790582851,
                    "size": 5254603,
                    "vd": 0
                },
                "l": {
                    "br": 96000,
                    "fid": 1212761325443605,
                    "size": 3161672,
                    "vd": -0.000265076
                },
                "a": {
                    "br": 64000,
                    "fid": 5830710162150141,
                    "size": 2119031,
                    "vd": 0
                },
                "cd": "",
                "rtUrl": null
            },
            {
                "rtUrls": [],
                "name": "人にやさしく",
                "id": 30245511,
                "v": 2,
                "st": 0,
                "t": 0,
                "fee": 0,
                "ftype": 0,
                "rtype": 0,
                "rurl": null,
                "no": 1,
                "pst": 0,
                "alia": [],
                "pop": 80,
                "rt": null,
                "mst": 9,
                "cp": 0,
                "crbt": null,
                "mv": 0,
                "cf": "",
                "ar": [
                    {
                        "id": 1047395,
                        "name": "THE ROLLING GIRLS"
                    }
                ],
                "al": {
                    "id": 3094448,
                    "name": "THE ROLLING GIRLS THEME SONGS COLLECTION",
                    "picStr": "7894493487528893",
                    "pic": 7894493487528893
                },
                "dt": 201480,
                "h": {
                    "br": 320000,
                    "fid": 7852712045676580,
                    "size": 8062179,
                    "vd": -2.36
                },
                "m": {
                    "br": 160000,
                    "fid": 7852712045676581,
                    "size": 4031619,
                    "vd": -1.96
                },
                "l": {
                    "br": 96000,
                    "fid": 7852712045676582,
                    "size": 2419395,
                    "vd": -2.1
                },
                "a": {
                    "br": 64000,
                    "fid": 7761452580569932,
                    "size": 1634106,
                    "vd": 0
                },
                "cd": "",
                "rtUrl": null
            },
            {
                "rtUrls": [],
                "name": null,
                "id": 29881275,
                "v": 3,
                "st": 0,
                "t": 1,
                "fee": 0,
                "ftype": 0,
                "rtype": 0,
                "rurl": null,
                "no": 0,
                "pst": 0,
                "alia": [],
                "pop": 0,
                "rt": null,
                "mst": 9,
                "cp": 0,
                "crbt": null,
                "mv": 0,
                "cf": null,
                "ar": [
                    {
                        "id": 0,
                        "name": null
                    }
                ],
                "al": {
                    "id": 0,
                    "name": null,
                    "picStr": "0",
                    "pic": 0
                },
                "dt": 219000,
                "h": {
                    "br": 320000,
                    "fid": 0,
                    "size": 8776247,
                    "vd": 0
                },
                "m": {
                    "br": 160000,
                    "fid": 0,
                    "size": 4388199,
                    "vd": 0
                },
                "l": {
                    "br": 96000,
                    "fid": 0,
                    "size": 2632979,
                    "vd": 0
                },
                "a": null,
                "cd": null,
                "rtUrl": null,
                "pc": {
                    "nickname": "Catofes",
                    "uid": 37734080,
                    "sn": "Mirai Miracle",
                    "ar": "Ghost",
                    "alb": "",
                    "br": 320,
                    "fn": "x13079310.mp3",
                    "cid": ""
                }
            }

做了一定的删减,所以数据不完全。可以看出新版本api(毕竟有v2的标识)对于普通曲子的返回结果也变了,直接返回了多个品质的曲子,对应的不同的mp3文件。然后也包涵了自己上传的曲子的相关信息。

重要的有两个信息,一个应该是曲子的id:
"id": 29881275,
一个我猜是用户uid
"uid": 37734080,

访问
http://music.163.com/api/cloud/media/url?id=29881275&uid=37734080&quality=h

既可以得到对应的曲子地址。这个Cookie 只需要 os=pc 这一个存在即可
{"url":"http://m3.music.126.net/20150331230203/a053fee8eb3543bc430d356caffbb1e7/NTMxMzgxODA=/d251a331521f3cfa7618c67ad1c5a54f.mp3","bitrate":320000,"size":8776247,"code":200}

得到的链接应该就是播放链接。

至于本身是网易云的音乐文件,重要的参数是:
"h": {
"br": 320000,
"fid": 7852712045676580,
"size": 8062179,
"vd": -2.36
},
里面的fid。

随后pc会请求

/2LrzOopZvDTHbpM-LJm86w==/7852712045676588.mp3?v=17509840 (这是另一个曲子的链接,和另外一个曲子的fid对应,原来曲子的连接地址被我刷掉了。)测试了一下前面的字符串和现行api.py里面的encrypted_id(id)函数返回的是一样的。

Fedora22 亲测支持

Fedora22 亲测支持 Cool …… 再也不用担心开着chrome 听 music.163 系统负载的问题了 赞……

Bug 按 = 加音量时报错

测试环境 openSuse 13.2 Python 2.7.8

错误信息

    Traceback (most recent call last):                                                                                                                                      

    File "/usr/lib/python2.7/site-packages/NetEase_MusicBox-0.1.5.6-py2.7.egg/NEMbox/__init__.py", line 15, in start 
    nembox_menu.start()

    File "/usr/lib/python2.7/site-packages/NetEase_MusicBox-0.1.5.6-py2.7.egg/NEMbox/menu.py", line 241, in start                                                         
    self.player.volume_up()                                                                                                                          

    File "/usr/lib/python2.7/site-packages/NetEase_MusicBox-0.1.5.6-py2.7.egg/NEMbox/player.py", line 162, in volume_up
        self.popen_handler.stdin.write("V " + str(self.volume) + "\n")
    IOError: [Errno 32] Broken pipe

查看代码,这一行代码为

def volume_up(self):
        self.volume = self.volume + 7
        if (self.volume > 100):
            self.volume = 100
        self.popen_handler.stdin.write("V " + str(self.volume) + "\n")

猜测原因:可能是对相关的设备的声卡支持不完整

remove键可以删除一些...奇怪的东西

remove键的检查机制里面只检查了datatype是不是main..所以这直接导致了这个行为可以影响一些奇怪的datatype,比如说帮助菜单什么的...我不知道这个是不是intended behavior...
#45 里的上移下移功能里的检查是参考remove功能的检查实现的,所以也可以移很多奇怪的东西...

我不是很清楚这个东西是不是本来就是设计成这样的...姑且问一问...

修改了一下login界面

image

密码是无回显 输入
并且 每次读入账号密码 后 不做验证直接丢给 网易去做验证
这样更符合 浏览器网页的输入模式,提高用户体验,只要输错就会有报错

Arch Linux报错ImportError:No module named 'menu'

-> % musicbox
Traceback (most recent call last):
File "/usr/bin/musicbox", line 9, in
load_entry_point('NetEase-MusicBox==0.1.3.0', 'console_scripts', 'musicbox')()
File "/usr/lib/python3.4/site-packages/pkg_resources/init.py", line 519, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.4/site-packages/pkg_resources/init.py", line 2630, in load_entry_point
return ep.load()
File "/usr/lib/python3.4/site-packages/pkg_resources/init.py", line 2310, in load
return self.resolve()
File "/usr/lib/python3.4/site-packages/pkg_resources/init.py", line 2316, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/lib/python3.4/site-packages/NetEase_MusicBox-0.1.3.0-py3.4.egg/src/init.py", line 8, in
from menu import Menu
ImportError: No module named 'menu'

播放音乐报错!

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/NetEase_MusicBox-0.1.5.6-py2.7.egg/NEMbox/init.py", line 15, in start
nembox_menu.start()
File "/usr/local/lib/python2.7/dist-packages/NetEase_MusicBox-0.1.5.6-py2.7.egg/NEMbox/menu.py", line 262, in start
self.player.play(datatype, datalist, idx)
File "/usr/local/lib/python2.7/dist-packages/NetEase_MusicBox-0.1.5.6-py2.7.egg/NEMbox/player.py", line 90, in play
self.pause()
File "/usr/local/lib/python2.7/dist-packages/NetEase_MusicBox-0.1.5.6-py2.7.egg/NEMbox/player.py", line 129, in pause
os.kill(self.popen_handler.pid, signal.SIGSTOP)
AttributeError: 'NoneType' object has no attribute 'pid'

音质问题

关于这个程序使用的云音乐的源的音质问题,我有一些疑问

今天读源码的时候注意到程序是从song details里面的'mp3Url'键值读取音乐播放地址的,但是我尝试了几首曲子,发现这个键值里面的音乐都是96kbps的mp3,而不是README里面说的320kbps

另一方面,我在另外一个项目中, 看到了关于网易云音乐音频存储的URL加密机制的说明文档和相关的加密算法,可以用来实现播放320kbps的mp3流

考虑到这个程序复杂的背景,只播放96kpbs音频可能是一种保险的做法,因为虽然加密算法是大家反向工程出来的,没有使用任何网易的代码,不存在版权问题,但是如果网易持有对上述算法的专利权的话,毫无疑问对于该算法的重实现也是违反专利权法的。

不过,鉴于上述的项目中的代码长期存在并且未被网易追究,而且我查阅了**国家知识产权局公众专利查询系统,并未查询到网易有申请和这个算法相关的专利记录,也许这一担心是多余的……

于是,我觉得现在我们要做的事情应该是这样的:

  • 如果觉得知识产权问题应该不是个问题的话,应该参照上述项目给出的算法在这个程序里面实现货真价实的320kbps播放
  • 如果怕惹麻烦的话,在维持现状的同时至少应该把README中的320kbps播放去掉……要不然实在太有误解性了……

这个该怎么做就得由Project owner @darknessomi 决定了 = =

非正常退出影响终端使用

RT,某些情况下非正常退出(如未联网播放音乐)会导致终端命令不回显,而且回车显示异常。
不算是严重的 bug 吧,不过可以改进一下么?

安装过程中出现问题

Traceback (most recent call last):
File "setup.py", line 38, in
from setuptools import setup, find_packages
ImportError: No module named setuptools

环境:ubuntu14.04 64位

非TLS登陆的安全问题

ae9a745 这个commit中为了回避证书错误问题而改用了未加密的http代理,可能引入安全问题.

某君曾言,"没有加密的身份验证都是耍流氓",我觉得还是加密比较好...

至于ubuntu下的证书错误问题,我觉得应该检查以下几点解决:

  1. music.163.com使用的TLS证书是否符合规范
  2. requests库的https请求处理使用的证书存储空间是否正确
  3. 测试机器上的证书存储配置是否正确

musicbox在FreeBSD下中文显示乱码

您好,

我在FreeBSD 10.1 RELEASE下(python版本为2.7_2,2,LC_ALL设置为zh_CN.UTF-8)尝试安装musicbox,过程都很顺利,没有错误。但运行它的时候,发现中文全是乱码,如图所示:

2015-06-17-191921_732x401_scrot

我猜想可能是FreeBSD下python对于编码转换方面有问题,不过我不懂python,所以不敢确定。您若有兴趣,希望您能帮忙看看这个问题。谢谢。

登录失败

艾玛,登录信息好像不对呢 (O_O)#

               [1] 再试一次
               [2] 稍后再试


               请键入对应数字:

能添加显示歌词嘛

记得以前网上有个版本可以查看歌词,不知道这个可不可以添加显示歌词

Linux下歌曲暂停后无法继续播放自动跳到下一首歌曲

问题重现方式:

从终端运行musicbox,进入搜索,进入精选集,随意找个精选集,开始播放列表歌曲。
若空格暂停某一首歌曲一会儿,如接个电话之类的事情,然后再次空格播放,
本来3分钟多的歌曲播放了一会(大概一分钟?)后,并没有完整播放,自动跳到列表歌曲的下一首。

不知这是否是Bug, 还是咱系统配置问题,目前只在我的作业系统Linux Mint 17.1 64位操作系统测试过有这问题。其他并未确认。

请指教。

api.py中有一个小bug以及一个小建议

bug:
在api.py中search函数体里面的limit被写死了,参数limit失去了调节返回数量的作用。导致每次响应都会返回60个结果。'limit': 60 => 'limit': limit

疑问:
在api.py中有一个import logger,可能我用的是python3的原因,告诉我没有getLogger这个函数。所以我就把logger换成了logging,这样就不会报错了。不知道在python3中这样改有没有不妥的地方?

建议:
因为win平台的限制,只能用api来进行二次开发。在我第一次尝试使用api的时候,却卡在了登陆那里,怎么弄都不行,然后查看ui.py文件发现,发出登陆请求前会对输入的密码进行一个md5的加密,这个加密过程不知道能不否放到api.py里面,这样其他有二次开发需求的人开发起来也会方便一些。当然,作为编程初学者,我不懂的东西很多,你们这样弄应该有这么弄的理由吧? : )

显示播放进度以及控制的相关问题

其实是我当初挖的坑。。为了加入音量功能,所以用了mpg123 的 -R模式。

mpg123 模式获取歌曲的长度的方法如下:

LP载入歌曲,SAMPLE 的第二个参数得到总体采样数目, FORMAT 的第一个参数得到采样率,相除就是秒数。

SAMPLE
@SAMPLE 0 9673465
FORMAT
@FORMAT 44100 2

获取当前播放时间可以关闭SILENCE模式,播放时会返回

@S 1.0 3 44100 Joint-Stereo 0 1044 2 1 1 0 320 0 0
@F 0 8396 0.00 219.32
@F 0 8396 0.00 219.32
@F 1 8395 0.03 219.30
@F 2 8394 0.05 219.27
@F 3 8393 0.08 219.25
@F 4 8392 0.10 219.22
@F 5 8391 0.13 219.19
@F 6 8390 0.16 219.17

格式的结构。 @s的 1044 表明一共1044帧, @f的第一个参数表示当前帧数。相除即可。

或者不停的输入SAMPLE, 计算当前位置。

SO 诸君的意思呢?

curses 库明显不能这么用!!!

看了看代码,api.py 里面充满了 hard code , 我觉得使用SIGWINCH 这个信号(平时主要用C写cureses,不知道python对应的信号机制),并且在 用户调整终端窗口 大小的时候 重绘 UI 否则 经常会发生curses 花屏问题 而 crash掉

like this:

signal(SIGWINCH, (void (*)(int)) handle_signal);  

void handle_signal(int signum)  
{  
    // handle a change in the window (i.e., a resizing)  
    if (signum == SIGWINCH)  
        redraw_all();  

    // re-register myself so this signal gets handled in future too  
   signal(signum, (void (*)(int)) handle_signal);  
}  

Can't search for song

Hey guys. Firstly thanks for the awesome tool. Unfortunately I can't search for specific songs or artists. It just says 'Nothing found' (I translated the program using google translator). Playlists, like charts etc. are working though. Is this a known error/ a way to fix this?
Thanks for your help!
My System: Ubuntu 14.04

Edit: Tried installing without editing the files. Still same problem
screenshot from 2015-05-05 02 43 15

archlinux报错

Traceback (most recent call last):
File "/bin/musicbox", line 5, in
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 3084, in
@_call_aside
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 3070, in _call_aside
f(_args, *_kwargs)
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 3097, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 651, in _build_master
ws.require(requires)
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 952, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 839, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'NetEase-MusicBox==0.1.5.6' distribution was not found and is required by the application

修改了一下搜索界面

把搜索的界面和主界面作成统一的了,还打算修复几个bug,问一下作者是否要接受这些改动,需要的话我pull 个request ,不需要的话,我就自己切个分支,自己开发自己的版本了。
image

Arch linux(arm 版本) 无法运行

报错如下:
menu已经通过pip安装成功
$ musicbox
Traceback (most recent call last):
File "/bin/musicbox", line 9, in
load_entry_point('NetEase-MusicBox==0.1.5.6', 'console_scripts', 'musicbox')()
File "/usr/lib/python3.4/site-packages/pkg_resources/init.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.4/site-packages/pkg_resources/init.py", line 2682, in load_entry_point
return ep.load()
File "/usr/lib/python3.4/site-packages/pkg_resources/init.py", line 2355, in load
return self.resolve()
File "/usr/lib/python3.4/site-packages/pkg_resources/init.py", line 2361, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/lib/python3.4/site-packages/NetEase_MusicBox-0.1.5.6-py3.4.egg/NEMbox/init.py", line 9, in
from menu import Menu
ImportError: cannot import name 'Menu'

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.