Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to track raw download size #127

Closed
jkbrzt opened this issue Jun 11, 2024 · 1 comment
Closed

Make it possible to track raw download size #127

jkbrzt opened this issue Jun 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jkbrzt
Copy link

jkbrzt commented Jun 11, 2024

When Content-Encoding is applied, we only get access to the decoded data.

HTTPie’s --download feature would benefit from having continuous access to a raw downloaded bytes counter so that it can provide a meaningful progress bar and validate that the downloaded size matches Content-Length (httpie/cli#423, httpie/cli#1531).

@Ousret Ousret added the enhancement New feature or request label Jun 19, 2024
Ousret added a commit that referenced this issue Jun 24, 2024
**Added**
- TransferProgress tracking in Response when downloading using `stream=True` based on the Content-Length. (#127)
  There's no easy way to track the "real" amount of bytes consumed using "iter_content" when the remote is
  sending a compressed body. This change makes it possible to track the amount of bytes consumed.
  The `Response` object now contain a property named `download_progress` that is either `None` or a `TransferProgress` object.
- HTTP/2 with prior knowledge over TLS or via an unencrypted connection.
  `disable_http1` toggle is now available through your `Session` constructor.
  In consequence, you may leverage all HTTP/2 capabilities like multiplexing using a plain (e.g. non-TLS) socket.
  You may enable/disable any protocols per Session object (but not all of them at once!).
  In non-TLS connections, you have to keep one of HTTP/1.1 or HTTP/2 enabled.
  Otherwise, one of HTTP/1.1, HTTP/2 or HTTP/3. A `RuntimeError` may be thrown if no protocol can be used in a
  given context.

**Changed**
- Relax main API constraint in get, head, options and delete methods / functions by accepting kwargs.
- urllib3-future lower bound version is raised to 2.8.900
Ousret added a commit that referenced this issue Jun 24, 2024
**Added**
- TransferProgress tracking in Response when downloading using `stream=True` based on the Content-Length. (#127)
  There's no easy way to track the "real" amount of bytes consumed using "iter_content" when the remote is
  sending a compressed body. This change makes it possible to track the amount of bytes consumed.
  The `Response` object now contain a property named `download_progress` that is either `None` or a `TransferProgress` object.
- HTTP/2 with prior knowledge over TLS or via an unencrypted connection.
  `disable_http1` toggle is now available through your `Session` constructor.
  In consequence, you may leverage all HTTP/2 capabilities like multiplexing using a plain (e.g. non-TLS) socket.
  You may enable/disable any protocols per Session object (but not all of them at once!).
  In non-TLS connections, you have to keep one of HTTP/1.1 or HTTP/2 enabled.
  Otherwise, one of HTTP/1.1, HTTP/2 or HTTP/3. A `RuntimeError` may be thrown if no protocol can be used in a
  given context.

**Changed**
- Relax main API constraint in get, head, options and delete methods / functions by accepting kwargs.
- urllib3-future lower bound version is raised to 2.8.900
Ousret added a commit that referenced this issue Jun 24, 2024
**Added**
- TransferProgress tracking in Response when downloading using
`stream=True` based on the Content-Length. (#127) There's no easy way to
track the "real" amount of bytes consumed using "iter_content" when the
remote is sending a compressed body. This change makes it possible to
track the amount of bytes consumed. The `Response` object now contain a
property named `download_progress` that is either `None` or a
`TransferProgress` object.
- HTTP/2 with prior knowledge over TLS or via an unencrypted connection.
`disable_http1` toggle is now available through your `Session`
constructor. In consequence, you may leverage all HTTP/2 capabilities
like multiplexing using a plain (e.g. non-TLS) socket. You may
enable/disable any protocols per Session object (but not all of them at
once!). In non-TLS connections, you have to keep one of HTTP/1.1 or
HTTP/2 enabled. Otherwise, one of HTTP/1.1, HTTP/2 or HTTP/3. A
`RuntimeError` may be thrown if no protocol can be used in a given
context.

**Changed**
- Relax main API constraint in get, head, options and delete methods /
functions by accepting kwargs.
- urllib3-future lower bound version is raised to 2.8.900
@Ousret
Copy link
Member

Ousret commented Jun 24, 2024

As I promised. It is now possible to track the real download speed. see version 3.7 changes
The decompression speed can be inferred also (based on output size).

@Ousret Ousret closed this as completed Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants