summaryrefslogtreecommitdiffstats
path: root/gallery_dl/downloader/http.py
diff options
context:
space:
mode:
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: