Need help in restricting the user to download the entire table block

Hey Guys,

Use Case: I need to stop the users to download the entire table on the basis of how many rows are there in the table block.

I know it can be done through custom solution, can i have the download button id or a way to capture the backend information of that download button and i can try to restrict the button function on the basis of how many number displayed on the table.