Support for env variable:
PLAYLIST - if set to 'yes' or 'true' files will be stored in subfolders named after playlist name or 'NA' if the files is not part of a playlist
Added variables:
RATE - to set a custom max download rate
MIN_SLEEP - to set a minim number of seconds to wait before next transfer (for playlist download)
MAX_SLEEP - to set a maximum number of seconds to wait before next transfer (for playlist download)
RM_CACHE_DIR - in case of download problems, you may want to clear cache before each download, set to true or yes
I'm replacing the 'http' in the protocol with 'ws'. If the protocol is just 'http' it will use 'ws' if it's 'https' it will end up being 'wss' (websocket secure)