That's way to many hoops to jump through

if you're using idm all you have to do is highlight the links in the filemanager and then click the download with idm that comes up and it will grab them itself.