you-get
you-get copied to clipboard
Use httpx or reuqests if available
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.
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.
祝您健康!
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.
Rebased to v0.4.1700