summaryrefslogtreecommitdiff
path: root/scripts/muggle_getlyrics
diff options
context:
space:
mode:
authorworo <woro@e10066b5-e1e2-0310-b819-94efdf66514b>2008-04-11 20:11:00 +0000
committerworo <woro@e10066b5-e1e2-0310-b819-94efdf66514b>2008-04-11 20:11:00 +0000
commit57d7ee812c8be1bd118471512682cb3393ce595f (patch)
tree2e0d792fc74eda1661b439853c004e2ed5c06820 /scripts/muggle_getlyrics
parentb2550195d6b61f9be3470679082b8d6b5159aa83 (diff)
downloadvdr-plugin-muggle-57d7ee812c8be1bd118471512682cb3393ce595f.tar.gz
vdr-plugin-muggle-57d7ee812c8be1bd118471512682cb3393ce595f.tar.bz2
merge mp3ng branch into trunk
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@1173 e10066b5-e1e2-0310-b819-94efdf66514b
Diffstat (limited to 'scripts/muggle_getlyrics')
-rwxr-xr-xscripts/muggle_getlyrics35
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/muggle_getlyrics b/scripts/muggle_getlyrics
new file mode 100755
index 0000000..80be1cf
--- /dev/null
+++ b/scripts/muggle_getlyrics
@@ -0,0 +1,35 @@
+rm -f "$3"
+txtfound=0
+artist=`echo $1 | sed 's/ /%20/'g`
+title=`echo $2 | sed 's/ /%20/'g`
+echo ich bin $0 mit $1 $2 $3 artist=$artist title=$title>> /tmp/log.wr
+echo fetchLyrics $artist $title | `dirname $0`/googlyrics 2>/dev/null |
+ sed 's/\x0d//g' |
+ sed 's/\xc2\xb4/\x27/g' |
+ sed 's/\xc3\x82\x27/\x27/g' |
+ sed 's/\xc3\x82/\x27/g' |
+ sed 's/\xc3\xb9/\x27/g' |
+ sed 's/\xe2\x80\x99/\x27/g' |
+ grep -ive 'NEW.*ringtones' |
+ recode HTML..utf8 |
+ sed 's/\xc2\x91/\x27/g' | # in unicode, those two are reserved for
+ sed 's/\xc2\x92/\x27/g' | # private use, but still some sites use them...
+while read line
+do
+# strip starting empty lines
+ notempty=0
+ test x"$line" = x || notempty=1;
+ test $notempty -eq 1 && txtfound=1;
+ test $txtfound -eq 1 -o $notempty -eq 1 && echo $line
+done > "$3".loading
+
+# use .loading because the file is already there when googlyrics starts
+# but muggle thinks we are done as soon as $3 exists
+
+if test -s "$3".loading
+then
+ mv "$3".loading "$3"
+else
+ rm -f "$3".loading
+fi
+test -s "$3" # we want the exit code