V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
turing
V2EX  ›  Node.js

豆瓣电台命令行版 0.0.9 发布

  •  
  •   turing · 2014-01-13 11:39:38 +08:00 · 14411 次点击
    这是一个创建于 3728 天前的主题,其中的信息可能已经有所发展或是发生改变。


    简洁优雅的豆瓣电台命令行版,基于 Node.js

    支持加 ❤ 、更新界面以及 bug 修复

    支持的快捷键:

    [return] - > 播放另一个频道,或者重新播放当前频道 (PLAY)
    [backspace] - > 停止播放当前歌曲或频道 (DELETE)
    [n] - > 本频道列表的下一首歌曲 (NEXT)
    [l] - > 添加到红心列表或者删除红心 (LOVE)
    [g] - > 跳转到当前播放歌曲的专辑页面 (GOTO)
    [q] - > 退出豆瓣电台 (QUIT)

    欢迎 star && fork
    https://github.com/turingou/douban.fm
    第 1 条附言  ·  2014-01-14 11:41:40 +08:00
    0.1.0 版本已发布,支持:

    - PRO 用户的高码率模式播放(默认192kpbs)
    - 修复 bug 若干
    - 添加分享到微博功能(快捷键:s)
    94 条回复    1970-01-01 08:00:00 +08:00
    pirex
        1
    pirex  
       2014-01-13 11:41:58 +08:00
    赞一个先。
    CRight
        2
    CRight  
       2014-01-13 11:54:08 +08:00 via Android
    可以登录吗?
    turing
        3
    turing  
    OP
       2014-01-13 11:57:32 +08:00
    @CRight 可以设置账户密码后收听私人频道
    Tink
        4
    Tink  
       2014-01-13 12:09:35 +08:00 via Android
    终于跟新了…
    wangfengmadking
        5
    wangfengmadking  
       2014-01-13 12:26:52 +08:00
    great, 终于等到了
    wenLiangcan
        6
    wenLiangcan  
       2014-01-13 12:38:32 +08:00
    o(*^▽^*)o
    nigelvon
        7
    nigelvon  
       2014-01-13 12:39:08 +08:00
    支持高码率么?仅限会员也行。
    MrX
        8
    MrX  
       2014-01-13 12:42:26 +08:00
    Love it!Great!
    chshouyu
        9
    chshouyu  
       2014-01-13 12:43:17 +08:00
    赞一个!
    turing
        10
    turing  
    OP
       2014-01-13 13:06:36 +08:00
    @nigelvon 会员我没折腾过,按道理这是豆瓣来处理的,如果你是会员,它应该会返回高码率的mp3
    mtmzorro
        11
    mtmzorro  
       2014-01-13 13:30:12 +08:00
    赞个 已star
    nigelvon
        12
    nigelvon  
       2014-01-13 14:14:30 +08:00
    @turing 恩,可能还有一个设置码率的api,因为无论是客户端还是web,如果是会员的话会多一个设置码率的选项。
    Imivan
        13
    Imivan  
       2014-01-13 15:00:54 +08:00
    会保存听过的歌曲好评
    isaced
        14
    isaced  
       2014-01-13 15:08:22 +08:00
    赞一个!
    luoluoluo
        15
    luoluoluo  
       2014-01-13 15:55:18 +08:00
    cool, fork.
    wolegequ
        16
    wolegequ  
       2014-01-13 15:57:07 +08:00 via Android
    怒赞
    ksex
        17
    ksex  
       2014-01-13 16:15:18 +08:00
    太酷了 +1
    liluo
        18
    liluo  
       2014-01-13 16:20:07 +08:00
    很棒
    manihome
        19
    manihome  
       2014-01-13 16:44:03 +08:00
    赞一个!
    teehoo
        20
    teehoo  
       2014-01-13 17:03:23 +08:00
    cool
    mactive
        21
    mactive  
       2014-01-13 17:12:10 +08:00
    已star
    哈哈 第一个dependencies 就是 player
    archean
        22
    archean  
       2014-01-13 17:15:03 +08:00
    顶赞啊!
    iYu
        23
    iYu  
       2014-01-13 17:20:44 +08:00
    为啥我的登录不能

    { [Error: ENOENT, open '/Users/xxx/douban.fm/.configs.json']
    errno: 34,
    code: 'ENOENT',
    path: '/Users/xxx/douban.fm/.configs.json' }
    archean
        24
    archean  
       2014-01-13 17:22:17 +08:00
    请问 backspace 后怎么继续播放当前歌曲?
    fsp
        25
    fsp  
       2014-01-13 17:22:35 +08:00
    @nigelvon 好用吗?
    turing
        26
    turing  
    OP
       2014-01-13 17:23:29 +08:00
    @iYu 去提个 issue 吧

    这个可能是写权限问题
    turing
        27
    turing  
    OP
       2014-01-13 17:23:42 +08:00
    @archean 再按 enter 就可以了
    iYu
        28
    iYu  
       2014-01-13 17:26:00 +08:00
    安装时候没有用sudo的结果是 播放时候需要sudo 囧。。。 来提要求了。 关闭可以一个r就好了。 码率不能调节么。 白冲半年会员了。
    turing
        29
    turing  
    OP
       2014-01-13 17:35:40 +08:00
    @iYu 会员的话,试试看在豆瓣电台的设置里默认选上高码率看看,暂时不太清楚这个有没有api
    iYu
        30
    iYu  
       2014-01-13 17:54:47 +08:00
    @turing 刚刚确认了一下 豆瓣电台 设置 一直选择的是 192kbps 然后 也google了一下果然没有API 唉
    turing
        31
    turing  
    OP
       2014-01-13 17:57:13 +08:00
    @iYu 那我充个会员体会一下吧,看能不能折腾出来
    yangxin0
        32
    yangxin0  
       2014-01-13 17:58:52 +08:00
    赞一个, 在这个广告横行的时代,这么干净利索的软件不多了。
    turing
        33
    turing  
    OP
       2014-01-13 18:12:19 +08:00   ❤️ 1
    @iYu 我充好了。

    可以拿到 192kbps 的音乐,改个参数就可以了。0.1.0 版本会上线这个功能。
    iYu
        34
    iYu  
       2014-01-13 20:25:27 +08:00
    @turing 再次送出感谢。 效率很高啊。
    itfanr
        35
    itfanr  
       2014-01-13 20:42:38 +08:00
    郭大厉害 赞!!!
    hustlzp
        36
    hustlzp  
       2014-01-13 20:44:36 +08:00
    赞!
    willerce
        37
    willerce  
       2014-01-13 20:53:45 +08:00
    太能折腾了,点赞!
    baocaixiong
        38
    baocaixiong  
       2014-01-13 21:21:44 +08:00
    哇,狂点32个赞哟。
    baocaixiong
        39
    baocaixiong  
       2014-01-13 21:45:22 +08:00
    Douban.fm 0.0.9 Loading 正在加载...
    我这是网络不好吗?
    turing
        40
    turing  
    OP
       2014-01-13 21:47:25 +08:00
    @baocaixiong 豆瓣电台通信失败,我这里也是,等等吧,估计挂了
    turing
        41
    turing  
    OP
       2014-01-13 21:58:15 +08:00
    douban.com/j/app/radio/people 接口通信失败,大家改天再试试看吧~
    Xi
        42
    Xi  
       2014-01-14 02:22:09 +08:00
    用上了,很赞!
    Xi
        43
    Xi  
       2014-01-14 02:23:17 +08:00
    话说没有暂定功能?
    sxd
        44
    sxd  
       2014-01-14 09:52:18 +08:00
    上小众了..
    zhujinliang
        45
    zhujinliang  
       2014-01-14 10:11:42 +08:00
    听了一上午了,很不错

    歌曲结束判断有bug,有时上一曲尚未结束,下一曲就开始了
    有个小毛病,歌曲标题太长后会顶到下一行,希望能修正一下,能根据窗口大小自动截短一下,最好能滚动显示
    希望有空格键暂停功能

    另外自动建的那个douban.fm目录我感觉不是很合适,我自己改成隐藏的目录了
    Moods
        46
    Moods  
       2014-01-14 10:34:57 +08:00
    不错啊。
    MapleObserver
        47
    MapleObserver  
       2014-01-14 11:32:55 +08:00
    这个不错,点赞!晚上回去试试。
    turing
        48
    turing  
    OP
       2014-01-14 11:47:25 +08:00
    @zhujinliang 恩,会在播放完前三四秒就开始播放下一首了

    标题这个太长,确实我也没办法。。试试把 iterm 或者终端调整成 100% 宽度占据屏幕一半那种模式吧。

    空格暂停下一个版本会加上。

    原本是有自己定义下载目录的功能的,但是后来想了一下可能遇到写权限问题,还是算了
    scalaview
        49
    scalaview  
       2014-01-14 11:55:26 +08:00
    点赞+1
    hahabrother
        50
    hahabrother  
       2014-01-14 12:31:19 +08:00
    windows下安装总是校验和出错,Ubuntu上npm安装的时候死活下载不下来。。
    hahabrother
        51
    hahabrother  
       2014-01-14 12:50:53 +08:00
    Error: shasum check failed for /home/ckh/tmp/npm-2353-i3nBuZao/1389673476728-0.5402016728185117/tmp.tgz
    就是这个错误、。。。
    banbanchs
        52
    banbanchs  
       2014-01-14 13:20:24 +08:00
    退出后光标会不见..
    turing
        53
    turing  
    OP
       2014-01-14 13:26:46 +08:00   ❤️ 1
    @hahabrother windows 安装的报错,可以去提一条安装错误的 issue ,应该是没有安装外部依赖

    ubuntu 下的错误是不是 npm 镜像 URL 配置的原因?可以附上你当前的 node,npm 的版本,去提一条 issue,以备忘
    SkyTodInfi
        54
    SkyTodInfi  
       2014-01-14 13:50:13 +08:00
    xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

    gyp: Error 1 running xcodebuild
    一定要xcode才能安装么?
    turing
        55
    turing  
    OP
       2014-01-14 13:53:08 +08:00
    @SkyTodInfi 要先安装 xcode command line tools
    0x61
        56
    0x61  
       2014-01-14 14:00:36 +08:00
    排队点赞~
    SkyTodInfi
        57
    SkyTodInfi  
       2014-01-14 15:44:00 +08:00
    @turing 我有CLT,而且刚才重装也不行,出错信息也显示存在CLT
    happydays12345
        58
    happydays12345  
       2014-01-14 15:48:46 +08:00
    没有windows版?
    turing
        59
    turing  
    OP
       2014-01-14 15:49:18 +08:00
    @SkyTodInfi 那看来可能真的要装 xcodebuild 了,我不确定这个是否包含在 CLT 中
    SkyTodInfi
        60
    SkyTodInfi  
       2014-01-14 15:52:56 +08:00
    @turing 经过搜索发现,很多人遇见这个问题,貌似是node-gyp的bug....
    baocaixiong
        61
    baocaixiong  
       2014-01-14 16:11:18 +08:00
    退出来之后光标不见了。。。。好不习惯。
    @turing
    hahabrother
        62
    hahabrother  
       2014-01-14 16:38:23 +08:00
    @turing ubuntu下也是校验出错,我再尝试一下,不行的话就告诉你我的版本。似乎我确实没有安装什么依赖。
    hahabrother
        63
    hahabrother  
       2014-01-14 17:13:49 +08:00
    楼主,问个白痴的问题。我下的是node在Ubuntu下的文件夹,里面的bin里直接有node的执行文件,我在用户环境中添加了node,可以运行npm命令。但是sudo npm就是找不到指令了,要怎么处理?我之前的错误是因为我没有sudo安装,sudo找不到npm,怎么解决呢?
    hahabrother
        64
    hahabrother  
       2014-01-14 17:28:29 +08:00
    楼主 ,安装的第一个错误是
    ../deps/mpg123/src/output/alsa.c:27: error: expected specifier-qualifier-list before ‘snd_pcm_format_t’
    ../deps/mpg123/src/output/alsa.c:30: error: ‘SND_PCM_FORMAT_S16’ undeclared here (not in a function)
    不知道楼主方便给个联系方式请教一下吗?
    turing
        65
    turing  
    OP
       2014-01-14 18:14:30 +08:00   ❤️ 1
    @hahabrother 安装的错误麻烦去仓库提交一下 issue ,可能有人曾经遇到过和你差不多的错误,解决起来也方便,v2ex 也不太方便阅读代码。
    turing
        66
    turing  
    OP
       2014-01-14 18:15:14 +08:00
    @hahabrother sudo 找不到 npm 就直接 which npm 然后把这个地址贴到 sudo 后边执行
    pipi32167
        67
    pipi32167  
       2014-01-14 18:52:10 +08:00
    @hahabrother 用正常方式安装吧,一般README或者README.md都会有安装方法:
    ./configure
    make
    sudo make install
    sophy
        68
    sophy  
       2014-01-14 19:08:35 +08:00
    希望能加上last.fm 同步哈哈哈,那样就爽歪歪了。。。
    zhangxiao
        69
    zhangxiao  
       2014-01-14 19:40:30 +08:00
    大爱,大赞
    hahabrother
        70
    hahabrother  
       2014-01-14 20:16:10 +08:00
    @turing 那啥。。我是小白,怎么去仓库提交issue?能给了个教程或者简单说下吗?打扰
    turing
        71
    turing  
    OP
       2014-01-14 20:21:41 +08:00
    hahabrother
        72
    hahabrother  
       2014-01-14 20:22:36 +08:00
    @turing ok, 多谢了~
    hahabrother
        73
    hahabrother  
       2014-01-14 20:32:15 +08:00
    @turing 搞定了,sudo apt-get install libasound2-dev,少安装了这个,虽然不知道这个是什么依赖。。。膜拜ing
    crs0910
        74
    crs0910  
       2014-01-14 20:45:56 +08:00
    好用 感谢
    hahabrother
        75
    hahabrother  
       2014-01-14 20:54:12 +08:00
    体验效果太棒了,正是世界上像楼主这样的人,把我们的生活变得更加美好~~
    hahabrother
        76
    hahabrother  
       2014-01-14 21:04:58 +08:00
    小建议,可能是因为我比较2,说明里的$ douban.fm -m [[email protected]] [password] ,我在输入账号密码的时候真的加了[]。。。是不是需要说明下不要[]
    lsmgeb89
        77
    lsmgeb89  
       2014-01-14 23:40:23 +08:00
    非常实用的东西,因为非常讨厌网页版用的 flash,长时间播放就会把整个机器卡死,Adobe 越做越差。还有能支持收藏的兆赫吗?
    hustlzp
        78
    hustlzp  
       2014-01-14 23:49:39 +08:00
    请教下楼主,我的机器是rMBP,已经安装了Command Developer Tools,直接sudo npm install duban.fm -g,然后卡在下面不动了...

    > [email protected] install /usr/local/lib/node_modules/douban.fm/node_modules/player/node_modules/speaker
    > node-gyp rebuild

    gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/hustlzp/.node-gyp/0.10.24"
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/douban.fm/node_modules/player/node_modules/speaker/.node-gyp"
    gyp http GET http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
    gyp http 200 http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
    hustlzp
        79
    hustlzp  
       2014-01-14 23:53:24 +08:00
    我去提交个issue吧
    SkyTodInfi
        80
    SkyTodInfi  
       2014-01-15 09:37:22 +08:00
    @hustlzp 参看我上面的说明
    hustlzp
        81
    hustlzp  
       2014-01-15 09:42:54 +08:00
    @SkyTodInfi node-gyp的bug...这...
    lsmgeb89
        82
    lsmgeb89  
       2014-01-15 09:50:17 +08:00
    从来没有折腾过 node.js,不是很了解,我看安装好之后的 duban.fm 是一个 shell 脚本,难道还要自己安装 cygwin?
    SkyTodInfi
        83
    SkyTodInfi  
       2014-01-15 10:13:02 +08:00
    @hustlzp 参考这里可以解决 https://github.com/TooTallNate/node-gyp/issues/341
    修改一个文件里面几行代码可以暂时解决,亲测可行
    hustlzp
        84
    hustlzp  
       2014-01-15 10:45:33 +08:00
    @SkyTodInfi

    非常感谢!!我是使用倒数第二个人给出的解决方案fix的,因为我是用brew安装的node:

    In case anyone is using Brew, it puts npm with node-gyp in the cellar:

    /usr/local/Cellar/node/0.10.24/lib/node_modules/npm/bin/node-gyp-bin/node-gyp
    /usr/local/bin/node-gyp

    Replace the first with a symlink to the second, and it works.

    Hopefully the next node build is going to include this fix, otherwise I have to do this again on every release.
    turing
        85
    turing  
    OP
       2014-01-15 12:02:41 +08:00
    @lsmgeb89 这部分的东西 npm 应该会帮你解决,不需要额外安装。
    lsmgeb89
        86
    lsmgeb89  
       2014-01-15 13:43:25 +08:00
    @turing 在 Node.js command prompt 执行 douban.fm 并不能运行。
    archean
        87
    archean  
       2014-01-15 14:12:29 +08:00
    顺带求个能够下载豆瓣红心音乐的脚本, 不知各位文艺工程师有没有私货, 或者写一个类似的?
    turing
        88
    turing  
    OP
       2014-01-15 14:41:18 +08:00
    @lsmgeb89 直接在 terminal 中执行
    lsmgeb89
        89
    lsmgeb89  
       2014-01-15 15:19:43 +08:00
    @turing 更加不行,不认。
    turing
        90
    turing  
    OP
       2014-01-15 15:29:32 +08:00
    @lsmgeb89 你是不是没安装到全局啊
    lsmgeb89
        91
    lsmgeb89  
       2014-01-15 16:32:04 +08:00
    @turing 你是指 Node.js 环境?
    HoHo
        92
    HoHo  
       2014-01-15 19:32:29 +08:00
    非常不错!
    IfengName
        93
    IfengName  
       2014-01-16 21:28:25 +08:00
    我是来学习的~
    yangkeao
        94
    yangkeao  
       2014-02-15 17:19:32 +08:00
    为什么我连如何选择电台都不知道
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5434 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 08:42 · PVG 16:42 · LAX 01:42 · JFK 04:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.