1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 12:12:34 +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 # Changelog
## Unreleased
## 1.12.1 - 2019-12-22 ## 1.12.1 - 2019-12-22
### Additions ### Additions
- [4chan] add extractor for entire boards ([#510](https://github.com/mikf/gallery-dl/issues/510)) - [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(): for key, value in data.items():
if value: if value:
data[key] = text.unquote(value) data[key] = text.unquote(value)
data["path"], _, name = data["path"].rpartition("/") data["path"], _, name = data["path"].rpartition("/")
data["filename"], _, ext = name.rpartition(".") data["filename"], _, ext = name.rpartition(".")
data["extension"] = ext.lower() data["extension"] = ext.lower()
data["_http_headers"] = {"Referer": self.url}
yield Message.Version, 1 yield Message.Version, 1
yield Message.Directory, data yield Message.Directory, data

View File

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