You can implement your own system for downloading using HTTP Endpoints and storing logs in a data table.
It was recently discussed on the Forum - Anvil Media URL - not permanent - #2 by jshaffstall
An example in your case can be
@anvil.server.http_endpoint('/media/:id')
def download_media(id):
ip_address=anvil.server.request.remote_address
media_row=app_tables.media.get_by_id(id)
app_tables.media_logs.add_row(ip=ip,media=media_row)
return media_row['Media_Column']
Relevant Docs - Anvil Docs | Creating HTTP APIs