用树莓派播放豆瓣FM电台,只需要3条简单的命令完成安装。
首先确认使用的树莓派OS是 Raspbian 系统,因为接下来要安装的应用是基于Linux的。
#安装 mplayer 播放器,如果之前没有装过的话 sudo apt-get install mplayer #安装 Python-pip sudo apt-get install python-pip #通过 Python-pip 安装 douban.fm sudo pip install douban.fm
这个 douban.fm 程序是来自 github 的一个开源项目,基于 douban 的 API。
安装完成之后,输入以下命令行即可进入播放器界面。
douban.fm
第一次登陆需要输入账号,密码,程序不会保留密码,而是保存返回的token存储在~/.douban_token.txt,下次登陆无需输入密码。
效果如下:
操作快捷键
移动
[j] –> 下
[k] –> 上
[g] –> 移到最顶
[G] –> 移到最底
音乐
[space] –> 播放
[w] –> 打开歌曲主页
[n] –> 下一首
[r] –> 喜欢/取消喜欢
[b] –> 不再播放
[q] –> 退出
[p] –> 暂停
[l] –> 单曲循环
音量(>=V0.2.9)
[=] –> 增
[-] –> 减
[m] –> 静音
歌词(>=v0.2.9)
[o] –> 显示歌词(Bug很多,先别用,没有反应就是没找到歌词)
[q] –> 退出歌词
.doubanfm_config保存在了~/.doubanfm_config,根据需要可以修改按键的映射
[key] UP = k # 上 DOWN = j # 下 TOP = g # 顶 BOTTOM = G # 底 OPENURL = w # 打开歌曲主页 RATE = r # 标记喜欢/取消喜欢 NEXT = n # 下一首 BYE = b # 不再播放 QUIT = q # 退出 PAUSE = p # 暂停 LOOP = l # 单曲循环 MUTE = m # 静音
这个要怎么解决QAQ
amixer: Mixer attach default error: No such file or directory
Traceback (most recent call last):
File “/usr/local/bin/douban.fm”, line 9, in
load_entry_point(‘douban.fm==0.2.13’, ‘console_scripts’, ‘douban.fm’)()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 337, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2279, in load_entry_point
return ep.load()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 1989, in load
entry = __import__(self.module_name, globals(),globals(), [‘__name__’])
File “/usr/local/lib/python2.7/dist-packages/douban/douban.py”, line 25, in
class Win(cli.Cli):
File “/usr/local/lib/python2.7/dist-packages/douban/douban.py”, line 43, in Win
sound_card = ‘Master’ if subprocess.check_output(‘amixer | grep Master’, shell=True) else ‘PCM’
File “/usr/lib/python2.7/subprocess.py”, line 544, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command ‘amixer | grep Master’ returned non-zero exit status 1
提示pop from empty list错误
pop from empty list的试试在红心单里加几首歌再进douban.fm
amixer: Unable to find simple control ‘Master’,0怎么解决?
Unable to find simple control ‘Master’ 参考这里 http://blog.csdn.net/juncoder/article/details/39269595
Exception in thread Thread-3:
Traceback (most recent call last):
File “/usr/lib/python2.7/threading.py”, line 552, in __bootstrap_inner
self.run()
File “/usr/lib/python2.7/threading.py”, line 505, in run
self.__target(*self.__args, **self.__kwargs)
File “/usr/local/lib/python2.7/dist-packages/douban/douban.py”, line 335, in run
self.set_play()
File “/usr/local/lib/python2.7/dist-packages/douban/douban.py”, line 363, in _func
func(self)
File “/usr/local/lib/python2.7/dist-packages/douban/douban.py”, line 416, in set_play
self.kill_mplayer()
File “/usr/local/lib/python2.7/dist-packages/douban/douban.py”, line 240, in kill_mplayer
self.p.stdin.write(‘quit 0\n’)
IOError: [Errno 32] Broken pipe
Exception in thread Thread-3:
Traceback (most recent call last):
File “/usr/lib/python2.7/threading.py”, line 552, in __bootstrap_inner
self.run()
File “/usr/lib/python2.7/threading.py”, line 505, in run
self.__target(*self.__args, **self.__kwargs)
File “/usr/local/lib/python2.7/dist-packages/douban/douban.py”, line 335, in run
self.set_play()
File “/usr/local/lib/python2.7/dist-packages/douban/douban.py”, line 363, in _func
func(self)
File “/usr/local/lib/python2.7/dist-packages/douban/douban.py”, line 416, in set_play
self.kill_mplayer()
File “/usr/local/lib/python2.7/dist-packages/douban/douban.py”, line 240, in kill_mplayer
self.p.stdin.write(‘quit 0\n’)
IOError: [Errno 32] Broken pipe
我也是这样的问题,请问如何解决呢
总感觉不是那么流畅。。
NameError: name ‘false’ is not defined 咋搞。。
这个命令是在哪里运行啊,终端?我运行douban.fm总提示未找到命令
好像是eval()的问题,得改源码
输入验证码…..验证码根本看不见好么
如何才能看到验证码?
验证码怎么处理呢
求验证码 求验证码
求验证码 求验证码 求验证码
验证码地址:
/tmp/captcha_pic.jpg
验证码怎么搞
无法登陆,提示账号不能为空怎么解决~?
提示出错!Traceback (most recent call last):
File “/usr/local/bin/douban.fm”, line 5, in
from pkg_resources import load_entry_point
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2876, in
working_set = WorkingSet._build_master()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 449, in _build_master
ws.require(__requires__)
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 745, in require
needed = self.resolve(parse_requirements(requirements))
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 639, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: cryptography==1.3.2
Traceback (most recent call last):
File “/usr/local/bin/douban.fm”, line 7, in
from doubanfm.douban import main
File “/usr/local/lib/python3.4/dist-packages/doubanfm/douban.py”, line 10, in
import Queue
ImportError: No module named ‘Queue’
我和小男孩的故障显示一样,小男孩你是怎么解决的?
invalid syntax (pycookiecheat.py, line 27)
运行douban.fm提示错误
同李同学,你是怎么解决的。
我也遇到楼上两位一样的问题不知道怎么解决
同上
nvalid syntax (pycookiecheat.py, line 27)
运行douban.fm提示错误
改用python3.5运行
同楼上
pycookiecheat.py报错应该怎么解决