[bunkr] fix video downloads (#3326)
by sending 'https://stream.bunkr.is/' as Referer header
This commit is contained in:
@@ -83,6 +83,7 @@ class BunkrAlbumExtractor(LolisafeAlbumExtractor):
|
|||||||
cdn = file["cdn"]
|
cdn = file["cdn"]
|
||||||
if name.endswith((".mp4", ".m4v", ".mov")):
|
if name.endswith((".mp4", ".m4v", ".mov")):
|
||||||
cdn = cdn.replace("//cdn", "//media-files")
|
cdn = cdn.replace("//cdn", "//media-files")
|
||||||
|
file["_http_headers"] = {"Referer": "https://stream.bunkr.is/"}
|
||||||
file["file"] = cdn + "/" + name
|
file["file"] = cdn + "/" + name
|
||||||
|
|
||||||
return files, {
|
return files, {
|
||||||
|
|||||||
@@ -71,11 +71,10 @@ class LolisafeAlbumExtractor(LolisafeExtractor):
|
|||||||
yield Message.Directory, data
|
yield Message.Directory, data
|
||||||
for data["num"], file in enumerate(files, 1):
|
for data["num"], file in enumerate(files, 1):
|
||||||
url = file["file"]
|
url = file["file"]
|
||||||
if "_fallback" in file:
|
file.update(data)
|
||||||
data["_fallback"] = file["_fallback"]
|
text.nameext_from_url(url, file)
|
||||||
text.nameext_from_url(url, data)
|
file["name"], sep, file["id"] = file["filename"].rpartition("-")
|
||||||
data["name"], sep, data["id"] = data["filename"].rpartition("-")
|
yield Message.Url, url, file
|
||||||
yield Message.Url, url, data
|
|
||||||
|
|
||||||
def fetch_album(self, album_id):
|
def fetch_album(self, album_id):
|
||||||
url = "{}/api/album/get/{}".format(self.root, album_id)
|
url = "{}/api/album/get/{}".format(self.root, album_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user