MPD HTTP streaming provide the media content at every URL thrown at the
HTTP backend. So requests for shoutcast and icecast metadata get stuck
receiving the actual media content, instead of the expected metadata.
The conclusion is to only request these metadata files, when they're not
actually advertised as audio or video content types in a HEAD request.
Playlist items would previously have been added once for each attempt,
due to items being scoped differently than the playlist parsing
attempts. Each attempt would add to the playlist every time, since we
only returned outside the attempts loop.
In the configuration, `max_duration` can be set to prevent
long song(URL item) being downloaded and added to the
playlist.
This whitelist feature provided a way to override this
duration check: songs being whitelisted will be added to
the playlist no matter how long they are.
Three admin commands are introduced:
- !urlwhitelist (!urlw)
- !urlunwhitelist, (!urlunw)
- !urlwhitelistlist, (!urlwls).
Also, if one song fails due to its length, the bot will
show the length of this song and the max length limit in
the reply message.
Implement #173, #196.
Currently, after downloading YouTube videos, FFmpeg is used to convert
the downloaded audio file into MP3 for historic reasons (there was no
database to keep the metadata around, so the ID3 tags in the MP3 file
were necessary to be able to read the metadata later on).
Now that a metadata database exists, this is no longer necessary. This
conversion is also fairly straining for slower CPUs or CPUs that do not
offer the appropriate processor extensions to be able to accelerate this
conversion, such as older ARM devices - in my case an ARMv7 32-bit
device, where the conversion could take over a minute for a fairly
simple 3-minute audio file of keeping a single core maxed out.
This should also result in less latency playing audio files on stronger
processors, though probably less noticeably.
Fixes#205
IMPORTANT NOTE:
The default database path has changed. It was database.db, but
now they ARE settings.db and music.db.
Database migration will detect music table in settings.db, and
move it out of settings.db.
To update from old version, you need to
1. if you use your own db path settings in the command
line or in configuration.ini, you don't have to change
anything;
1. or,if you use default database path, rename database.db
into settings.db.