Add live display of lyrics to music files downloaded from NetEase Cloud Music (163 key
included in metadata) that are being played in DeaDBeeF (or foobar2000)
See "Acknowledgments" below, I've sorted them according to the process, you should get a rough idea. In fact, the way it is implemented is quite funny, but it can work
For Linux GNOME, this extension needs to be installed additionally: jieran233/gnome-get-all-titles
git clone https://github.com/jieran233/gnome-get-all-titles.git cd gnome-get-all-titles make && make install
Edit preferences of DeaDBeeF (Edit > Preferences > UI/Misc > Player)
- Title bar text during playback:
\<DeaDBeeF\> {"status": "$if(%ispaused%,paused,playing)", "time": "%playback_time%/%length%", "path": "%path%"} \</DeaDBeeF\>
- Title bar text when stopped:
\<DeaDBeeF\>\</DeaDBeeF\>
Clone this repo, create venv and activate it, install requirements. Run python main.py
Play music files downloaded from NetEase Cloud Music (163 key
included in metadata) in DeaDBeeF
Check http://127.0.0.1:5000
, use an old Android mobile phone for showing lyrics, or continue to the following chapter
Choose a background image as wallpaper for the web page, copy it to static/images
and rename to background
(no extension)
You should find a satisfied position and font size for lyrics display element in your wallpaper
- First, modify line 154
return render_template('index.html',
inmain.py
, replace 'index.html' to 'index-wallpaper.html' - Modify line 139
.container {}
intemplates/index-wallpaper.html
for position of lyrics - Modify line 60
SCALE=
intemplates/index-wallpaper.html
for font size scaling of lyrics - Modify line 180
<div class="container">
intemplates/index-wallpaper.html
to<div class="container no-select">
if you want to make lyrics not selectable
Run main.py
, use browser F12 DevTool for quick preview changes, and write results back to index-wallpaper.html
Check this project: jeffshee/hidamari, install it by following its README
Open Hidamari in your app launcher, set Web Page URL as http://127.0.0.1:5000
Copy mylyric.desktop.template
and rename the copy to mylyric.desktop
, edit its Exec=
Move mylyric.desktop
to ~/.config/autostart
Attention that it can impact performance
In building this project, we would like to acknowledge the contributions of the following references:
- Highly customizable music player: DeaDBeeF-Player/deadbeef
- Get title of windows on Windows: Kalmat/PyWinCtl
- Get title of windows on GNOME (Wayland or X): jieran233/gnome-get-all-titles (forked from lucaswerkmeister/activate-window-by-title)
- Read metadata of music file: quodlibet/mutagen
- Decrypt AES in ECB mode: Legrandin/pycryptodome
- NetEase Cloud Music API: 2061360308/NeteaseCloudMusic_PythonSDK
- Web server: pallets/flask
- Web template engine pallets/jinja
- WebSocket: Flask-SocketIO
- Noto CJK fonts: notofonts/noto-cjk
- Identify language of certain lyrics to use the corresponding font of CJK fonts
- Regex for matching Japanese: https://gist.github.com/terrancesnyder/1345094
- Regex for matching Korean: https://regexr.com/3d0tf
- Identify Chinese text as being Simplified or Traditional: tsroten/hanzidentifier
- Use an old Android mobile phone for showing lyrics
- Disable screen timeout easily: elastic-rock/KeepScreenOn
- Embed web browser in desktop as wallpaper for showing lyrics
- For Linux desktop: jeffshee/hidamari
- For Windows: Wallpaper Engine (A popular proprietary software; Not tested yet)
163 key
decrypting references:
Lyric parsing references: