Progeny42 / refrapt

Tool to create local Debian mirrors using Python
GNU General Public License v3.0
34 stars 5 forks source link

[REQUEST] Use a Python module instead of wget #28

Open efficks opened 2 years ago

efficks commented 2 years ago

Describe the feature(s) you would like, and why refrapt depends on wget to works. It would be useful to stop depending on it and use python module like request or httpx to do the job. Like that, the OS does not need wget to work and you can implement mode advanced feature in refrapt and more precise http request. Maybe it will also make the tool work on any OS.

Does not having this feature stop you from using Refrapt? No. I like the tool. If you accept this request, maybe I can work on a pull request.

Progeny42 commented 2 years ago

I had a look at the requests library. It looks interesting. Refrapt currently uses wget due to it being a port from apt-mirror. I know the existing code is probably not ideal, especially because of the use of the system() call which is executing the wget command.

The most recent release of Refrapt added a few extra parameters to the wget command to handle timeouts and specific HTTP error codes. If the requests module, or others, support all the same features that are currently being used for wget in refrapt, then I'd be happy to move to it.

Again, if you have the inclination, I'd be happy to review and merge a pull request if it is suitable.