1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

[directlink] send Referer headers (closes #536)

This commit is contained in:
Mike Fährmann 2019-12-25 17:17:07 +01:00
parent 83909ab5d4
commit bf3df3d0b0
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
3 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,7 @@
# Changelog
## Unreleased
## 1.12.1 - 2019-12-22
### Additions
- [4chan] add extractor for entire boards ([#510](https://github.com/mikf/gallery-dl/issues/510))

View File

@ -55,9 +55,11 @@ class DirectlinkExtractor(Extractor):
for key, value in data.items():
if value:
data[key] = text.unquote(value)
data["path"], _, name = data["path"].rpartition("/")
data["filename"], _, ext = name.rpartition(".")
data["extension"] = ext.lower()
data["_http_headers"] = {"Referer": self.url}
yield Message.Version, 1
yield Message.Directory, data

View File

@ -6,4 +6,4 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
__version__ = "1.12.1"
__version__ = "1.12.2-dev"