apkeep icon indicating copy to clipboard operation
apkeep copied to clipboard

Downloads sometimes fail to complete fully

Open android-t709 opened this issue 1 year ago • 1 comments

I'm not sure if I should put this here or in https://github.com/EFForg/rs-google-play. Sometimes, downloads fail to complete. For example:

Downloading com.instagram.android...
[00:00:11] ████████████████░░░░░░░░░░░░░░░░░░░░░░░░ 31.95 MiB/75.64 MiB | com.instagram.android.apk An error has occurred attempting to download com.instagram.android. Retry #1... error details: request or response body error: error reading a body from connection: end of file before message length reached

(I added mp_log.println(format!("error details: {}", err)).unwrap(); in src/google_play.rs)

By default, it tries to download again, but will fail, because the file already exists.

I tried using a (poorly) modified version of https://github.com/EFForg/rs-google-play/blob/master/gpapi/src/lib.rs to account for the length of the file and delete if the download doesn't match the expected length. Sleeping and retrying works quite well here, but this doesn't handle split apks well. (Should redownloads of failed files be handled by apkeep, or by gpapi?)

I couldn't figure out how to use something like reqwest_resume to resume dropped connections.

My primary use case is trying to reliably bulk-download apks from a list. (apkeep -r 1 still has intermittent issues at the start of a download, and most downloads fail ~100 apps in)

android-t709 avatar Aug 13 '24 14:08 android-t709

Have you tried introducing a sleep duration between downloads with -s?

Hainish avatar Feb 08 '25 02:02 Hainish