assetdownload module¶
-
assetdownload.
downloadAssetThumbnail
(thumbnail_url, temp_dir=None)¶ Downloads the given thumbnail url and saves it into a temporary file. Returns the path of the temporary file on success. Returns the empty string on failure.
-
assetdownload.
downloadFile
(file_url, destination_path, file_name=None)¶ Downloads the file from the given url and places it in specified destination folder. If ‘file_name’ is not specified, then the downloaded file is named by the one that is listed in the ‘Contents-Type’ header from http response. Returns the path of the downloaded file on success. Returns the empty string on failure.
-
assetdownload.
endsWithAnyOf
(file_path, extension_list)¶ Return whether the file ends with any of the extensions in the list. This only looks at last extension, after the last dot
-
assetdownload.
extractArchive
(archive_path, destination_path, required_extension=None)¶ Precondition: isSupportedArchive(archive_path) == True. Extracts the specified archive file and stores the contents in ‘destination_path’. If required_extension is specified, then only files inside the archive that have this extension will be extracted from the archive.
-
assetdownload.
extractGzipArchive
(archive_path, destination_path, required_extension)¶ Precondition: archive_path is a gzip file.
-
assetdownload.
extractZipArchive
(archive_path, destination_path, required_extension)¶ Precondition: archive_path is a zip archive. If required_extension is specified, then only files inside the archive that have this extension will be extracted from the archive.
-
assetdownload.
getAssetsFromURL
(url)¶ Queries the url and returns a list of details on the assets that are available for download.
-
assetdownload.
getAssetsFromURLAsStringArray
(url)¶ Queries the url and returns a list of assets in the form of a string array. The string array has the following format: [ “asset_name1”, “asset_description1”, “asset_author1”,
“asset_version1”, “asset_thumbnail1”, “asset_download_url1”, “asset_last_modified1”, “asset_name2”, “asset_description2”, … ]
-
assetdownload.
gzipExtensions
()¶ Supported extensions for gzip archives
-
assetdownload.
isSupportedArchive
(file_path)¶ Returns whether the file is an archive type that is supported for downloadable assets by Houdini. The current supported archive formats are: zip.
-
assetdownload.
zipExtensions
()¶ Supported extensions for zip archives