added the --check-duplicate option
minor fixes and aligned download_resources to download signature
--directory now create intermediate directories