aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl/downloader/http.py
diff options
context:
space:
mode:
authorAakash Gajjar <skyqutip@gmail.com>2020-08-26 20:22:32 +0530
committerGitHub <noreply@github.com>2020-08-26 20:22:32 +0530
commit19a107f21c7544b5e49a58040d09d9465f6858b1 (patch)
tree8325ffd206d9da1ce53f24b9ab4690abe175144d /youtube_dl/downloader/http.py
parent7f7edf837c1af059f64a4968b942a83f86cf6206 (diff)
downloadhypervideo-pre-19a107f21c7544b5e49a58040d09d9465f6858b1.tar.lz
hypervideo-pre-19a107f21c7544b5e49a58040d09d9465f6858b1.tar.xz
hypervideo-pre-19a107f21c7544b5e49a58040d09d9465f6858b1.zip
Revert "pull changes from remote master (#190)" (#193)
This reverts commit b827ee921fe510a8730a9fab070148ed2b8279b5.
Diffstat (limited to 'youtube_dl/downloader/http.py')
-rw-r--r--youtube_dl/downloader/http.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/downloader/http.py b/youtube_dl/downloader/http.py
index 5046878df..3c72ea18b 100644
--- a/youtube_dl/downloader/http.py
+++ b/youtube_dl/downloader/http.py
@@ -227,7 +227,7 @@ class HttpFD(FileDownloader):
while True:
try:
# 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
# errno set
except socket.timeout as e:
@@ -299,7 +299,7 @@ class HttpFD(FileDownloader):
'elapsed': now - ctx.start_time,
})
- if data_len is not None and byte_counter == data_len:
+ if is_test 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: