you-get icon indicating copy to clipboard operation
you-get copied to clipboard

Use httpx or reuqests if available

Open URenko opened this issue 1 year ago • 3 comments

I have cleaned some deprecated request methods. And then use httpx or reuqests, which has been installed in almost all python environments, if available (they are not required, and will fallback to urllib if neither is present)。

By using httpx/reuqests, we can benefit from:

  • Built-in session management
  • Built-in decoding (e.g. gzip, brotli)
  • Built-in retries
  • HTTP/2 if avaliable

I kept them for maximum compatibility with the original processing (urllib). And has been tested in each of the 3 environments (through make test and some personal usages). If necessary, I can add tests for the 3 environments to GitHub action.

URenko avatar Mar 02 '23 08:03 URenko

Hello @URenko, Thanks for the Pull Request. We :heart: our contributors! Please wait for one of our human maintainers to review your patches. This may take a few days to weeks. Also, please understand that although your Pull Request may or may not be eventually merged, we value all contributions equally.

祝您健康!

soimort-bot avatar Mar 02 '23 08:03 soimort-bot

By the way, I have found a project named "handle all HTTP(s) using Requests" at https://github.com/soimort/you-get/projects?type=classic . Do you have plans to deprecate urllib support entirely? If so it could be more elegant, and I'd be glad to help you.

URenko avatar Mar 02 '23 09:03 URenko

Rebased to v0.4.1700

URenko avatar May 22 '24 09:05 URenko