plateaukao / einkbro

A small, fast web browser based on Android WebView. It's tailored for E-Ink devices but also works great on normal android devices.
Other
1.05k stars 77 forks source link

fix: speed up Epub generation when images are on defunct hosts #345

Closed uqs closed 5 months ago

uqs commented 5 months ago

We can be aggressive in the connect timeout, as the user will have just (successfully?) opened whatever page they want converted, so it can't be horribly broken and giving up sooner on stale images is better. The browser doesn't have this issue, as it will lazily/asynchronously load in the images (or not), but for the epub we need to wait for all downloads to finish.

This helps with blogs that have affiliate Amazon links with tracking pixles pointing to https://ir-na.amazon-adsystem.com which no longer responds and thus piles on timeout after timeout.

Future changes should use a Threadpool to have more of these downloads in parallel.

This helps with issues #344 and #316