deadbeef 0.5.6发布了

Totem,mplayer,sopcast,realplayer,bmp
回复
funicorn
帖子: 1318
注册时间: 2005-09-13 4:56
系统: Ubuntu Jammy Jellyfi

deadbeef 0.5.6发布了

#1

帖子 funicorn » 2012-10-23 20:57

http://deadbeef.sourceforge.net/

顺便分享一个infobar用的歌词脚本,从baidu歌词上挖的
[bash]
#!/bin/bash

# Infobar plugin for DeaDBeeF music player
# Copyright (C) 2011-2012 Dmitriy Simbiriatin <dmitriy.simbiriatin@gmail.com>

# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

# This an example lyrics script which fetches lyrics from http://lyrics.com.

# Encoded artist name.
ARTIST="$1"

# Encoded song title.
TITLE="$2"
#Encoded album name.
ALBUM="$3"

# By default, plugin encodes spaces using '_' character, you can use sed to
# replace them with the character you need.

# Lyrics.com uses '-' to encode the spaces, so we gonna replace default '_'
# characters with them.
ARTIST=`echo "$ARTIST" | sed 's/_/-/g'`

# Same as for artist name.
TITLE=`echo "$TITLE" | sed 's/_/-/g'`

# XPath expression to find the lyrics on the page.
#EXP="//div[@id=\"on_tour\"]"
EXP="//div[@class=\"lrc-content\"]"

# URL template.
#URL_TEMP="http://www.lyrics.com/$TITLE-lyrics-$ARTIST.html"
#URL_TEMP="http://www.xiami.com/search?key=$ARTIST+$TITLE+$ALBUM"
URL_TEMP="http://music.baidu.com/search/lrc?key=$ ... TLE+$ALBUM"
# I'm using xml_grep utility from "xml twig" package here (you can easily find
# this package in your favorite distro) to parse an html page, and "w3m" to form
# a pretty-looking lyrics text.
xml_grep -html $EXP $URL_TEMP | w3m -dump -T text/html | sed 1d | sed '/^复制歌词/,$d';

exit 0;
[/bash]
在自带的example.sh基础上改的。百度这个2货提供的歌词也不知道从哪找来的,提供了歌手、歌名、专辑,它居然还能显示好多段一样的歌词,而且格式都一模一样,没办法预处理只好本地处理,有点脏,凑合用吧。
lulusee
帖子: 69
注册时间: 2009-05-14 0:51

Re: deadbeef 0.5.6发布了

#3

帖子 lulusee » 2012-10-24 10:20

:em11 :em11
mraandtux
论坛版主
帖子: 5211
注册时间: 2009-12-12 19:29
系统: Kubuntu

Re: deadbeef 0.5.6发布了

#4

帖子 mraandtux » 2012-10-24 14:10

坐等Deepin版
funicorn
帖子: 1318
注册时间: 2005-09-13 4:56
系统: Ubuntu Jammy Jellyfi

Re: deadbeef 0.5.6发布了

#5

帖子 funicorn » 2012-10-24 19:35

今天man了xml_grep发现看漏了,原来可以指定匹配次数的,这就容易多了。
修改版,默认匹配歌手+歌名+专辑,如果匹配不到就只匹配歌手+歌名,只dump第一段匹配内容。
保存之后在deadbeef的infobar歌词配置里启用该脚本就可以了。
[bash]
#!/bin/bash

# Infobar plugin for DeaDBeeF music player
# Copyright (C) 2011-2012 Dmitriy Simbiriatin <dmitriy.simbiriatin@gmail.com>

# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

# This an example lyrics script which fetches lyrics from http://lyrics.com.

# Encoded artist name.
ARTIST="$1"

# Encoded song title.
TITLE="$2"

#Encoded album name.
ALBUM="$3"

# By default, plugin encodes spaces using '_' character, you can use sed to
# replace them with the character you need.

# Lyrics.com uses '-' to encode the spaces, so we gonna replace default '_'
# characters with them.
ARTIST="`echo "$ARTIST" | sed 's/_/ /g'`"

# Same as for artist name.
TITLE="`echo "$TITLE" | sed 's/_/ /g'`"

# XPath expression to find the lyrics on the page.
#EXP="//div[@id=\"on_tour\"]"
EXP="//div[@class=\"lrc-content\"]"

# URL template.
#URL_TEMP="http://www.lyrics.com/$TITLE-lyrics-$ARTIST.html"
URL_TEMP="http://music.baidu.com/search/lrc?key=$ ... TLE+$ALBUM"
# I'm using xml_grep utility from "xml twig" package here (you can easily find
# this package in your favorite distro) to parse an html page, and "w3m" to form
# a pretty-looking lyrics text.

total=$(xml_grep --count -html $EXP "$URL_TEMP" | sed -n 2p |awk '{print $2}')

if [ $total -eq 0 ]; then
URL_TEMP="http://music.baidu.com/search/lrc?key=$ARTIST+$TITLE"
echo "$URL_TEMP"
fi

xml_grep --nb_results 1 -html $EXP "$URL_TEMP" | w3m -dump -T text/html | sed 1d;

exit 0;

[/bash]
对了,如果不是特别需要,infobar里面歌词网站别开那么多,留着最上面的那个就行了。baidu上东西虽然乱,但是好处是够全,不匹配专辑名搜的话绝大部分都能搜到,而且速度也快。
头像
soswxl
帖子: 33
注册时间: 2009-08-08 12:18
系统: Ubuntu 12.10

Re: deadbeef 0.5.6发布了

#6

帖子 soswxl » 2012-10-26 18:25

:em11 这个不错,sourceforge还被墙呢?
头像
Strange
帖子: 1824
注册时间: 2006-05-19 9:54
来自: Shanghai

Re: deadbeef 0.5.6发布了

#7

帖子 Strange » 2012-10-26 18:50

这次支持cp936了。
期待mac版啊
ニンニク入れますか?
x60 with gentoo
头像
maoyaotang
帖子: 256
注册时间: 2011-03-12 14:40
来自: 伤感地带城市,梅穿裤子小区

Re: deadbeef 0.5.6发布了

#8

帖子 maoyaotang » 2012-10-26 19:31

都知道啦 :em20
opensuse和fedora手动安装显卡http://maoyaotang.blog.163.com/
头像
fuhaoyun
帖子: 526
注册时间: 2009-05-08 14:12
来自: http://weibo.com/u/2201287863

Re: deadbeef 0.5.6发布了

#9

帖子 fuhaoyun » 2012-10-27 20:07

:em11 NB

只用Ubuntu/Unity:安全、高效、自由、简洁!
http://weibo.com/u/2201287863
----------------------------------------------------
用了4年Ubuntu,发现离开windows也可以活得很好
看球赛、炒股、聊天、office等等都不算问题了
一切都是习惯,困难解决了就好

回复