diff options
| author | 2022-02-10 22:50:56 -0500 | |
|---|---|---|
| committer | 2022-02-10 22:50:56 -0500 | |
| commit | 99bc014c924c755f10a4a930b1a83efabd84fde1 (patch) | |
| tree | 596bbab18416b66adf87011a0a6e439468f68778 /gallery_dl/extractor/lolisafe.py | |
| parent | 8a812de1450d5d53fc1cd9a59f6c3f08452fc5b1 (diff) | |
New upstream version 1.20.4.upstream/1.20.4
Diffstat (limited to 'gallery_dl/extractor/lolisafe.py')
| -rw-r--r-- | gallery_dl/extractor/lolisafe.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gallery_dl/extractor/lolisafe.py b/gallery_dl/extractor/lolisafe.py index cdaf22b..c63fa51 100644 --- a/gallery_dl/extractor/lolisafe.py +++ b/gallery_dl/extractor/lolisafe.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2021 Mike Fährmann +# Copyright 2021-2022 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -42,6 +42,11 @@ class LolisafelbumExtractor(LolisafeExtractor): "num": int, }, }), + # mp4 (#2239) + ("https://bunkr.is/a/ptRHaCn2", { + "pattern": r"https://cdn\.bunkr\.is/_-RnHoW69L\.mp4", + "content": "80e61d1dbc5896ae7ef9a28734c747b28b320471", + }), ("https://bunkr.to/a/Lktg9Keq"), ("https://zz.ht/a/lop7W6EZ", { "pattern": r"https://z\.zz\.fo/(4anuY|ih560)\.png", @@ -66,6 +71,11 @@ class LolisafelbumExtractor(LolisafeExtractor): url = file["file"] text.nameext_from_url(url, data) data["name"], sep, data["id"] = data["filename"].rpartition("-") + + if data["extension"] == "mp4": + data["_http_validate"] = self._check_rewrite + else: + data["_http_validate"] = None yield Message.Url, url, data def fetch_album(self, album_id): @@ -77,3 +87,13 @@ class LolisafelbumExtractor(LolisafeExtractor): "album_name": text.unescape(data["title"]), "count" : data["count"], } + + @staticmethod + def _check_rewrite(response): + if response.history and response.headers.get( + "Content-Type").startswith("text/html"): + # consume content to reuse connection + response.content + # rewrite to download URL + return response.url.replace("/v/", "/d/", 1) + return True |
