mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 06:35:12 +00:00 
			
		
		
		
	Revert erroneous use of the Content-Length header (#637)
				
					
				
			This reverts commit 6c907eb33f
The use of the Content-Length value here is erroneous and may lead
to truncated downloads if a compression scheme is specified in the
Content-Encoding header, as the Content-Length header refers to the
size of encoded data, not of the raw bytestream. This has been noticed
in the wild with WebVTT subtitle segments.
Authored by: fstirlitz
			
			
This commit is contained in:
		| @@ -238,7 +238,7 @@ class HttpFD(FileDownloader): | |||||||
|             while True: |             while True: | ||||||
|                 try: |                 try: | ||||||
|                     # Download and write |                     # Download and write | ||||||
|                     data_block = ctx.data.read(block_size if data_len is None else min(block_size, data_len - byte_counter)) |                     data_block = ctx.data.read(block_size if not is_test else min(block_size, data_len - byte_counter)) | ||||||
|                 # socket.timeout is a subclass of socket.error but may not have |                 # socket.timeout is a subclass of socket.error but may not have | ||||||
|                 # errno set |                 # errno set | ||||||
|                 except socket.timeout as e: |                 except socket.timeout as e: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Felix S
					Felix S