Download

class apkinjector.download.ProgressCompleted(filename: str, path: str)
class apkinjector.download.ProgressDownloading(filename: str, progress: int)
class apkinjector.download.ProgressFailed(filename: str, status_code: int)
class apkinjector.download.ProgressUnknown(filename: str, path: str)
apkinjector.download.download_file(url: str, target_path: str, progress_callback: Optional[Callable] = None) → str

Download a file from a given URL and save it on the target path.

Parameters
  • url (str) – The URL from where file needs to be downloaded.

  • target_path (str) – The path on local system where the downloaded file should be saved.

  • progress_callback (Optional[Callable]) – Function to call when the progress changes, defaults to None.

Returns

The target path where the file has been downloaded.

Return type

str