summaryrefslogtreecommitdiffstats
path: root/gallery_dl/downloader/http.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-08-13 17:45:31 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2021-08-13 17:45:31 -0400
commitd50ba9cfe80f00e02ca9a4714f75699c00e67128 (patch)
tree01fe7b46370d5068b8c692ae5ea95cab4d734bd8 /gallery_dl/downloader/http.py
parent873d9a628e9412a79bdc64cd962470749de3425b (diff)
New upstream version 1.18.3.upstream/1.18.3
Diffstat (limited to 'gallery_dl/downloader/http.py')
-rw-r--r--gallery_dl/downloader/http.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py
index 76ec46f..78d8d34 100644
--- a/gallery_dl/downloader/http.py
+++ b/gallery_dl/downloader/http.py
@@ -98,20 +98,21 @@ class HttpDownloader(DownloaderBase):
time.sleep(tries)
tries += 1
- headers = {"Accept": "*/*"}
file_header = None
- # check for .part file
- file_size = pathfmt.part_size()
- if file_size:
- headers["Range"] = "bytes={}-".format(file_size)
- # general headers
- if self.headers:
- headers.update(self.headers)
- # file-specific headers
+ # collect HTTP headers
+ headers = {"Accept": "*/*"}
+ # file-specific headers
extra = kwdict.get("_http_headers")
if extra:
headers.update(extra)
+ # general headers
+ if self.headers:
+ headers.update(self.headers)
+ # partial content
+ file_size = pathfmt.part_size()
+ if file_size:
+ headers["Range"] = "bytes={}-".format(file_size)
# connect to (remote) source
try: