codewario/PocketLibraryImages

Provide workaround when Invoke-WebRequest can't complete the download due to Github closing the server connection

codewario opened this issue · 2 comments

For larger archives (at this time, this really only affects the GBA image archive as for what the Pocket supports), the download can fail as Github may reset the connection if the download takes too long. I have not been able to reproduce this at the browser level (tested with msedge).

Provide a workaround when this case is hit to provide a local file path to an image archive. I'm not sure whether download resuming is possible as code archive downloads do not advertise the size of the file.

A long term-solution may be to try using a well-known browser user-agent in case Github treats browsers differently, or see if the behavior persists when using WebClient to download the file, but for now a path-based workaround should suffice.

I've been able to reproduce this at the browser level now. Still, having this option will be a potential bandwidth saver if you already have an image archive downloaded.

Script now supports providing a local path to the image archive, and instructions have been provided to create the export from a git clone if the repo archive cannot be obtained any other way.