[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
3 changed files with 5 additions and 1 deletions

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