Yes, this is definitely possible. Are you wanting help to write this script yourself, or are you requesting that someone else write it?
If you'd like me to have a go, please email me a small track with DRM (as I don't have any) so I can test this and see what I can do.
If you want to have a go yourself, great! What help do you need?