'Call download plugin to generate the temp files we will load into deluge
then verify they are valid torrents'

@plugin.priority(120)
def on_task_download(self, task, config):

    import deluge.ui.common
    config = self.prepare_config(config)
    if (not config[u'enabled']):
        return
    if (u'download' not in task.config):
        download = plugin.get_plugin_by_name(u'download')
        for entry in task.accepted:
            if (not entry.get(u'deluge_id')):
                download.instance.get_temp_file(task, entry, handle_magnets=True)
    for entry in task.accepted:
        if os.path.exists(entry.get(u'file', u'')):
            try:
                deluge.ui.common.TorrentInfo(entry[u'file'])
            except Exception:
                entry.fail(u'Invalid    torrent    file')
                log.error(u'Torrent    file    appears    invalid    for:    %s', entry[u'title'])
