Skip to content

Commit

Permalink
pmusic - Update elyrics grabber
Browse files Browse the repository at this point in the history
  • Loading branch information
zigbert authored Mar 25, 2024
1 parent e0e26d7 commit a7c04ea
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,9 @@ pMusic will search for lyrics in')\nelyrics.net\nlyrics.fandom.com\njamendo.com"
T=${TITLE%%(*}; T=${T//_/ }; T=${T//-/,,}; T=${T// /-}; T=${T//\'/}; TMP_TITLE="${T,,}"
TMP_CHAR=${TMP_ARTIST:0:1} #first char
rm $WORKDIR/tmplyrics
wget -U "$USERAGENT" -t 3 --connect-timeout=3 -O $WORKDIR/tmplyrics http://www.elyrics.net/read/$TMP_CHAR/$TMP_ARTIST-lyrics/$TMP_TITLE-lyrics.html
LYRICS="`cat $WORKDIR/tmplyrics | tr '>' '\n' | grep -B 1000 -m1 'Correct these lyrics' | grep -A 1000 -F "id='inlyr'" | sed 's%<br%%g' | grep -vF '<' | grep -vF 'http' | head -n -3 `"
[ "$LYRICS" ] && echo "http://www.elyrics.net/read/$TMP_CHAR/$TMP_ARTIST-lyrics/$TMP_TITLE-lyrics.html" > ${MYDIR}_lyrics_source
wget -U "$USERAGENT" -t 3 --connect-timeout=3 -O $WORKDIR/tmplyrics https://www.elyrics.net/read/$TMP_CHAR/$TMP_ARTIST-lyrics/$TMP_TITLE-lyrics.html
LYRICS="`cat $WORKDIR/tmplyrics | tr '>' '\n' | grep -B 1000 -m1 'correctlyrics' | grep -A 1000 -F "id='inlyr'" | grep -v -e '^$' | sed 's%<br%%g' | grep -vF '<' | grep -vF 'http' | head -n -3 `"
[ "$LYRICS" ] && echo "https://www.elyrics.net/read/$TMP_CHAR/$TMP_ARTIST-lyrics/$TMP_TITLE-lyrics.html" > ${MYDIR}_lyrics_source
fi
echo "$LYRICS" > ${MYDIR}_lyrics
#save to DB
Expand Down

0 comments on commit a7c04ea

Please sign in to comment.