[boosty] send 'Authorization' header for file downloads (#8704)
This commit is contained in:
@@ -49,6 +49,9 @@ class BoostyExtractor(Extractor):
|
||||
self.videos = videos
|
||||
|
||||
def items(self):
|
||||
headers = self.api.headers.copy()
|
||||
del headers["Accept"]
|
||||
|
||||
for post in self.posts():
|
||||
if not post.get("hasAccess"):
|
||||
self.log.warning("Not allowed to access post %s", post["id"])
|
||||
@@ -61,6 +64,7 @@ class BoostyExtractor(Extractor):
|
||||
"post" : post,
|
||||
"user" : post.pop("user", None),
|
||||
"count": len(files),
|
||||
"_http_headers": headers,
|
||||
}
|
||||
|
||||
yield Message.Directory, "", data
|
||||
|
||||
@@ -38,6 +38,10 @@ __tests__ = (
|
||||
"extension": "",
|
||||
"filename" : "75f86086-fc67-4ed2-9365-2958d3d1a8f7",
|
||||
|
||||
"_http_headers": {
|
||||
"!Accept": str,
|
||||
"Origin" : "https://www.boosty.to",
|
||||
},
|
||||
"file": {
|
||||
"height" : 2048,
|
||||
"id" : "75f86086-fc67-4ed2-9365-2958d3d1a8f7",
|
||||
|
||||
Reference in New Issue
Block a user