Download a folder from s3

I am using the dl_manager.download_custom() to download files from a folder in S3. However, it throws a IsADirectoryError: [Errno 21] Is a directory. How can I circumvent this?