summaryrefslogtreecommitdiffstats
path: root/gallery_dl/downloader/http.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-03-13 16:26:30 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-03-13 16:26:30 -0500
commit3201d77a148367d739862b4f07868a76eaeb7cb1 (patch)
tree78b8d71633ec000672a84ad0bbbddd0513ae2d30 /gallery_dl/downloader/http.py
parentfc83315c164afd74734adf27e0f7fec2011904aa (diff)
New upstream version 1.17.0.upstream/1.17.0
Diffstat (limited to 'gallery_dl/downloader/http.py')
-rw-r--r--gallery_dl/downloader/http.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py
index 8d72dc2..bc42d7c 100644
--- a/gallery_dl/downloader/http.py
+++ b/gallery_dl/downloader/http.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2014-2020 Mike Fährmann
+# Copyright 2014-2021 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -31,6 +31,7 @@ class HttpDownloader(DownloaderBase):
self.downloading = False
self.adjust_extension = self.config("adjust-extensions", True)
+ self.headers = self.config("headers")
self.minsize = self.config("filesize-min")
self.maxsize = self.config("filesize-max")
self.retries = self.config("retries", extractor._retries)
@@ -93,13 +94,16 @@ class HttpDownloader(DownloaderBase):
time.sleep(tries)
tries += 1
- headers = {}
+ 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
extra = pathfmt.kwdict.get("_http_headers")
if extra: