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