[downloader/http] Finish downloading once received data length matches expected
[youtube-dl] / youtube_dl / downloader / http.py
index 3c72ea18b2304befd5221960503ff5b6141304c3..970103a8ddcca661f01fe7c3837e0050871b542d 100644 (file)
@@ -299,7 +299,7 @@ class HttpFD(FileDownloader):
                     'elapsed': now - ctx.start_time,
                 })
 
-                if is_test and byte_counter == data_len:
+                if data_len is not None and byte_counter == data_len:
                     break
 
             if not is_test and ctx.chunk_size and ctx.data_len is not None and byte_counter < ctx.data_len: